title: jQuery addClass onClick
body: <p>The setting is easy; I want to be able to add a class to (in this case) a button when onClick-event is fired. My problem is that I haven't found a way to pass the button itself as the parameter to the function. I'd like to do something like:</p>
  
  <pre><code>&lt;asp:Button ID="Button" runat="server" onclick="addClassByClick(this)"/&gt;
  </code></pre>
  
  <p>And then a javaScript function something like this:</p>
  
  <pre><code>function addClassByClick(button){
      button.addClass("active")
  }
  </code></pre>
  
  <p>I know I've got a lot of errors here, but that's why I'm posting. I've tried different scenarios with jQuery and without jQuery but I always end up with a broken solution (clicks suddenly stop coming through, class not added etc etc) so I decided to ask the pro's.</p>
  
  <p>Any suggestion to what I can try? Thanks for reading <strong>edit</strong>and all the help!</p>