[jQuery] Hide/Close div when clicked outside of it.

[jQuery] Hide/Close div when clicked outside of it.


Hi All,
I am showing a div on click of a hyperlink. Now, when i click
elsewhere in
the document other than the div itself, then i want to hide the
showing
div... Is there any easy way to do this?
I've already try:
$('html').click(function() { $('#divLoginBox1').hide(); });
and
$('body').click(function() { $('#divLoginBox1').hide(); });
but this close div when clicked inside of it.
Thanks,
Alex