title: Replace style with JS to multiple clases
body: <p>How can i do this code work with multiple classes?</p>
  
  <pre><code>$("td.field_358").each(function() {
      var td = document.getElementsByClassName('field_358');
      for (i = 0; i &lt; td.length; i++) {
          if (td[i].innerHTML.indexOf('Yes') !== -1) {
              td[i].style.backgroundColor = '#f7fef7';
          } else if (td[i].innerHTML.indexOf('No') !== -1) {
              td[i].style.backgroundColor = '#fbe8ea';
          }
      }  
  })
  </code></pre>
  
  <p>Actually i'm repeating the code for diferents classes, just replacing the class... field_358, field_123...etc.
  Its possible to do something more handy like:</p>
  
  <pre><code>$("td.field_358", "td.field_359", "td.field_360").each(function() {
    var td = document.getElementsByClassName('field_358', 'field_359', 'field_360');
  });
  </code></pre>
  
  <p>I'm a JS Noob...</p>