title: Hide all elements that come after the nth element
body: <p>After the 4th <code>&lt;a&gt;</code> element is found, how would I <code>.hide()</code> the rest? Below is the code I've written so far:</p>
  
  <pre><code>&lt;script src="http://code.jquery.com/jquery-latest.js"&gt;&lt;/script&gt;
  
  &lt;script&gt;
      $(document).ready(function() {
          if($('a').length &gt;= 4) {
              window.alert('4 or more');
          }
      });
  &lt;/script&gt;
  
  &lt;a&gt;test &lt;/a&gt;&lt;br&gt;
  &lt;a&gt;fed &lt;/a&gt;&lt;br&gt;
  &lt;a&gt;fdes &lt;/a&gt;&lt;br&gt;
  &lt;a&gt;grr &lt;/a&gt;&lt;br&gt;
  &lt;a&gt;rerf &lt;/a&gt;&lt;br&gt;
  &lt;a&gt;dferf &lt;/a&gt;
  </code></pre>
  
  <p>Any ideas?</p>