Proper way of binding events with jQuery
<p>I am somewhat new to Javascript but even more green with jQuery. I've already come across something that's got me scratching my head.</p>

<p>What is the difference between:</p>

<pre><code>$('.foo').click(function(){
//blah
});
</code></pre>

<p>and</p>

<pre><code>$('.foo').onclick = function(){
//blah
}
</code></pre>

<p>I prefer the second way but it doesn't seem to work. Am I doing something wrong?</p>

<p>Thanks in advance.</p>
