title: jQuery click event not working after adding class
body: <p>In my JSP page I added some links:</p>
  
  <pre><code>&lt;a class="applicationdata" href="#" id="1"&gt;Organization Data&lt;/a&gt;
  &lt;a class="applicationdata" href="#" id="2"&gt;Business Units&lt;/a&gt;
  &lt;a class="applicationdata" href="#" id="6"&gt;Applications&lt;/a&gt;
  &lt;a class="applicationdata" href="#" id="15"&gt;Data Entity&lt;/a&gt;
  </code></pre>
  
  <p>It has a jQuery function registered for the click event:</p>
  
  <pre><code>$("a.applicationdata").click(function() {
      var appid = $(this).attr("id");
      $('#gentab a').addClass("tabclick");
      $('#gentab a').attr('href', '#datacollector');
  });
  </code></pre>
  
  <p>It will add a class, <code>tabclick</code> to <code>&lt;a&gt;</code> which is inside <code>&lt;li&gt;</code> with <code>id="gentab"</code>. It is working fine. Here is my code for the <code>&lt;li&gt;</code>:</p>
  
  <pre><code>&lt;li id="applndata"&gt;&lt;a class="tabclick" href="#appdata" target="main"&gt;Application Data&lt;/a&gt;&lt;/li&gt;
  &lt;li id="gentab"&gt;&lt;a href="#datacollector" target="main"&gt;General&lt;/a&gt;&lt;/li&gt;
  </code></pre>
  
  <p>Now I have a jQuery click handler for these links</p>
  
  <pre><code>$("a.tabclick").click(function() {
      var liId = $(this).parent("li").attr("id");
      alert(liId);        
  });
  </code></pre>
  
  <p>For the first link it is working fine. It is alerting the <code>&lt;li&gt;</code> id. But for the second <code>&lt;li&gt;</code>, where the <code>class="tabclick"</code> is been added by first jQuery is not working.</p>
  
  <p>I tried <code>$("a.tabclick").live("click", function()</code>, but then the first link click event was also not working.</p>