Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script class="jsbin" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<meta charset=utf-8 />
<title>Test Page</title>
<style>
  body {
    font-family: sans-serif;
  }
</style>
</head>
<body>
  <p style="border:2px ridge #5C0D12; opacity:0.3;">I have color: #333</p>
  <p>I don't</p>
  <p style="color: #333;">I do</p>
  <p>I don't</p>
</body>
</html>
 
(function() {
  
  // Get all elements that have a style attribute
  var elms = document.querySelectorAll("*[style]");
  
  // Loop through them
  Array.prototype.forEach.call(elms, function(elm) {
    // Get the color value
    var clr = elm.style.color || "";
    
    // 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 "border:2px ridge #5C0D12; opacity:0.3;":
      case "red":
      case "border:2px rgb(92,13,18)":
      case "rgb(51,51,51)":
      case "#333333":
        elm.style.color = "yellow";
        break;
    }
  });
})();
Output

This bin was created anonymously and its free preview time has expired (learn why). — Get a free unrestricted account

Dismiss x
public
Bin info
anonymouspro
0viewers