title: Combining a class selector and an attribute selector with jQuery
body: <p>Is it possible to combine both a class selector <em>and</em> an attribute selector with jQuery?</p>
  
  <p>For example, given the following HTML:</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;TABLE&gt;
    &lt;TR class="myclass" reference="12345"&gt;&lt;TD&gt;Row 1&lt;/TD&gt;&lt;/TR&gt;
    &lt;TR class="otherclass" reference="12345"&gt;&lt;TD&gt;Row 2&lt;/TD&gt;&lt;/TR&gt;
    &lt;TR class="myclass" reference="12345"&gt;&lt;TD&gt;Row 3&lt;/TD&gt;&lt;/TR&gt;
    &lt;TR class="myclass" reference="54321"&gt;&lt;TD&gt;Row 4&lt;/TD&gt;&lt;/TR&gt;
  &lt;/TABLE&gt;
  </code></pre>
  
  <p>What would be the selector I can use to select rows 1 and 3 only?</p>
  
  <p>I have tried:</p>
  
  <pre class="lang-js prettyprint-override"><code>$(".myclass [reference=12345]") // returns nothing
  
  $(".myclass, [reference=12345]") // returns all 4 rows (yes, I know the comma means 'or')
  </code></pre>
  
  <p>I'm sure the answer is very simple and I have tried searching the jQuery forums and documentation but I can't seem to figure this one out. Can anyone help?</p>