//PARAMS color = document.currentScript.getAttribute('data-color') background = document.currentScript.getAttribute('data-background') width = document.currentScript.getAttribute('data-size') var color = isValidHexaCode(color) ? color : "#000000" var background = isValidHexaCode(background) ? background : "#ffffff" var width = width ? parseInt(width) : "100%" var txt = '' txt += "" txt += "
"; element = document.getElementById("js-container") preview = document.getElementById("js-text") if(preview){ $('#js-text').val("") } if (element){ document.getElementById("js-container").innerHTML = txt; }else{ document.write(txt); } function isValidHexaCode(str) { // Regex to check valid // hexadecimalColor_code let regex = new RegExp(/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/); // if str // is empty return false if (str == null) { return false; } // Return true if the str // matched the ReGex if (regex.test(str) == true) { return true; } else { return false; } } $(document).ready(function(){ let parentWidth = $('.NFLWeather_properties_current').width(); if (parentWidth > 370) { $('.NFLWeather_game_box_current').addClass('large') } });