title: Passing a parameter to javascript function via CSS Selector
body: <p>So, in short, I have a set of .li </p>
  
  <pre><code>&lt;ul&gt;
    &lt;li class="lmit_1"&gt;&lt;a href="#" &gt;Home&lt;/a&gt;&lt;/li&gt;
    &lt;li class="lmit_2"&gt;&lt;a href="#"&gt;About us&lt;/a&gt;&lt;/li&gt;
    &lt;li class="lmit_3"&gt;&lt;a href="#"&gt;Who we are&lt;/a&gt;&lt;/li&gt;
    &lt;li class="lmit_4"&gt;&lt;a href="#"&gt;Whats new&lt;/a&gt;&lt;/li&gt;
    &lt;li class="lmit_5"&gt;&lt;a href="#"&gt;Contact Us&lt;/a&gt;&lt;/li&gt;    
  &lt;/ul&gt;
  </code></pre>
  
  <p>and my javascript (jQuery)</p>
  
  <pre><code>&lt;script&gt;
    $(".lmit_" + id).click(function () {
      alert(id);
    });
  &lt;/script&gt;
  </code></pre>
  
  <p>What I am trying to do is receive whatever number is at the end of the css class as a parameter (.lmit_3 for example would allow id = 3) and therefore alert(id) should lead to a popup with the number 3? I am new to both programming and javascript so my apologies if the answer is staring me in the face...</p>