I would like to know whether this is the correct way of hiding visible elements when clicked anywhere on the page.
$(document).click(function (event) {
$('#myDIV:visible').hide();
});
The element (div, span, etc.) shouldn't disappear when a click event occurs within the boundaries of the element.