User:Killer9000/common.js: Difference between revisions

From wowdev
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
var divs = $("div");
 
console.log(divs);
var elms = document.querySelectorAll("*[style]");
if (divs.css("background-color") > "cccccc")
Array.prototype.forEach.call(elms, function(elm) {
   divs.css("background-color", "00000000");
  // Get the color value
  var clr = elm.style.background|| "";
  console.log(clr);
  // Remove all whitespace, make it all lower case
  clr = clr.replace(/\s/g, "").toLowerCase();
  // Switch on the possible values we know of
   switch (clr)
  {
  case "#eee":
    elm.style.color = "#000000";
    break;
  }
});

Revision as of 22:20, 14 May 2022

var elms = document.querySelectorAll("*[style]");
Array.prototype.forEach.call(elms, function(elm) {
  // Get the color value
  var clr = elm.style.background|| "";
  console.log(clr);
  // Remove all whitespace, make it all lower case
  clr = clr.replace(/\s/g, "").toLowerCase();
   // Switch on the possible values we know of
  switch (clr)
  {
  case "#eee":
    elm.style.color = "#000000";
    break;
  }
});