title: Get numerical value at end of class name and store as variable using jQuery
body: <p>Consider this menu output by a WordPress function:</p>
  
  <pre><code>&lt;ul id="header-cats"&gt; 
  
      &lt;li class="cat-item cat-item-6"&gt;&lt;a href="url" title="View all posts filed under Category I"&gt;Category I&lt;/a&gt; 
  &lt;/li&gt; 
      &lt;li class="cat-item cat-item-7"&gt;&lt;a href="url" title="View all posts filed under Category II"&gt;Category II&lt;/a&gt; 
  &lt;/li&gt; 
      &lt;li class="cat-item cat-item-8"&gt;&lt;a href="url" title="View all posts filed under Category III"&gt;Category III&lt;/a&gt; 
  &lt;/li&gt; 
  
  &lt;/ul&gt; 
  </code></pre>
  
  <p>Now consider this list of posts:</p>
  
  <pre><code>&lt;ul id="posts-preview" class="clearfix"&gt; 
  
      &lt;li class="filter-reset filter-hide filter-6 "&gt;             
          &lt;a class="post-thumb" id="post-112" href="url" &gt;Link&lt;/a&gt;        
      &lt;/li&gt;
  
      &lt;li class="filter-reset filter-hide filter-6 filter-8 "&gt;            
          &lt;a class="post-thumb" id="post-102" href="url" &gt;Link&lt;/a&gt;        
      &lt;/li&gt;
  
      &lt;li class="filter-reset filter-hide filter-7 "&gt;             
          &lt;a class="post-thumb" id="post-88" href="url" &gt;Link&lt;/a&gt;         
      &lt;/li&gt;
  
      &lt;li class="filter-reset filter-hide filter-6 "&gt;             
          &lt;a class="post-thumb" id="post-6" href="url" &gt;Link&lt;/a&gt;      
      &lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>My aim is to use a jQuery function to extract the numerical ending of the menu's class name (ie. the <code>6</code> in <code>cat-item 6</code>) and use that value to target the corresponding post. To elaborate I would use that <code>6</code> as a variable and find the <code>filter</code> class that ends in <code>6</code>.</p>
  
  <p>Here is what I have so far:</p>
  
  <pre><code>  $('#header-cats li').click(function(){  
  
      var num_id = $(this).attr('class') // ... matching "cat-item-?" etc...
  
          $(".filter-"+num_id).fadeIn(500); 
  
          return false;
  
    });
  </code></pre>
  
  <p>Should be easy for a js fiend :-)</p>