hide div when click outside using jquery
<p>I write this code to hide div when user click anywhere in body outside this div.. but is wrong what is the problem ?</p>

<pre><code>$('body').click(function() {
   $('.mydiv').hide();
});
</code></pre>
