title: Get ID of clicked list item
body: <p><a href="http://jsfiddle.net/Ht8eP/3/" rel="nofollow">http://jsfiddle.net/Ht8eP/3/</a></p>
  
  <p>In the previous example I catch every clicked list item explicitly by it's ID, which isn't practical &amp; efficient specially with too many items. What I want to achieve is to get it dynamically without hard coding all list items.</p>
  
  <pre><code>$(function() {
      $("#a1").click(function()
      {
          document.getElementById("dropdown").innerHTML = "A-1";
          document.getElementById("result").innerHTML = process("a1");
      });
  
      $("#a2").click(function()
      {
          document.getElementById("dropdown").innerHTML = "A-2";
          document.getElementById("result").innerHTML = process("a2");
      });
  
      $("#a3").click(function()
      {
          document.getElementById("dropdown").innerHTML = "A-3";
          document.getElementById("result").innerHTML = process("a3");
      });
  });
  
  function process(param)
  {
      // Some processing!
      return param;
  }
  </code></pre>