title: Using "this" in an onclick function
body: <p>I have TRs that are added dynamically after the page is loaded.  When they are clicked, I want to add the class "Active" to them.  Here is what I have so far:</p>
  
  <pre><code>&lt;tr onClick="makeActive(this);"&gt;&lt;td&gt;....&lt;/td&gt;&lt;/tr&gt;
  
  &lt;script&gt;
  function makeActive(element){$('.Active').removeClass('Active');element.addClass('Active');}
  &lt;/script&gt;
  </code></pre>
  
  <p>The function runs, and removes the "Active" class from any rows that currently have it applied...but it fails to add the class to the clicked row.</p>
  
  <p>Thanks for any help!</p>