title: Jquery attribute selector
body: <p>I have a variable (div element) which contains some table html.</p>
  
  <p>I can use this javascript to add a class to each cell that has a background set.</p>
  
  <pre><code>  var tds = tempDiv.getElementsByTagName("TD");
    for (var j = 0; j &lt; tds.length; j++) {
      var oTd = tds[j];
  
      if (oTd.style.background.length &gt; 0) {
        oTd.className = 'faketh';
        oTd.setAttribute('style', 'Clear');
      } //if
    }//for
  </code></pre>
  
  <p>what i'd like to do is do the same in jquery.  Below is what i've come up with, and the second line works fine, but the first doesn't....</p>
  
  <pre><code>  $(tempDiv).find("td[style*='background:']").addClass("faketh");
    $(tempDiv).find("td").removeAttr('style');
  </code></pre>
  
  <p>Any help would be appreciated.</p>
  
  <p>Edit: 
  Just to add; I'm using the code below without issue.</p>
  
  <pre><code>  $(tempDiv).find("tr:odd").addClass('row0');
    $(tempDiv).find("tr:even").addClass("row1");
  </code></pre>
  
  <p>So its not the adding of the class thats the problem... The issue is that i'm not finding any matching elements.  Here is one of the td elements;</p>
  
  <pre><code>&lt;td valign="top" class="faketd" style="border: 1pt solid windowtext; padding: 0cm 5.4pt; background: silver none repeat scroll 0% 0%; width: 131.4pt; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous;"&gt;
          &lt;p style="margin: 0cm 0cm 0pt; text-align: justify;"&gt;&lt;strong&gt;VPN Name/Description:&lt;/strong&gt;&lt;/p&gt;
          &lt;/td&gt;
  </code></pre>