title: jquery hidden parent
body: <p>ummm, probably a simple one... the code below only works with visible (show()) elements how do I get it select the first hidden element instead?</p>
  
  <p>Jquery</p>
  
  <pre><code>$(".postSelectedRules").each(function() {
      $(this).parents("#idruleB-"+$(this).attr("id").substr(8)+":hidden:first").css('background', '#bbbbbb');
  });
  </code></pre>
  
  <p>Html</p>
  
  <pre><code>&lt;a id="idruleA-1" class="postSelectedRules" href="#"&gt;1&lt;/a&gt;
  &lt;div class="postStuff"&gt;
      &lt;div class="postRules"&gt;
          &lt;span id="idruleB-1" class="postRulesSelect"&gt;1&lt;/span&gt;
          &lt;span id="idruleB-2" class="postRulesSelect"&gt;2&lt;/span&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>