title: What's the difference between using jQuery's onclick and the onclick attribute?
body: <p>What's the difference between the following two pieces of HTML (apologies if there are any typos as I'm typing this freehand)?</p>
  
  <p>Using jQuery:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      $(document).ready(function() {
          $("#clickme").click(function() {
              alert("clicked!");
          });
      });
  &lt;/script&gt;
  
  &lt;a id="clickme" href="javascript:void(0);"&gt;click me&lt;/a&gt;
  </code></pre>
  
  <p>Not using jQuery:</p>
  
  <pre><code>&lt;a id="clickme" href="javascript:void(0);" onclick="alert('clicked!');"&gt;click me&lt;/a&gt;
  </code></pre>