I have a JavaScript that displays a DIV (sets its display css property from \'none\' to \'normal\'. Is there a way to give it focus as well so that when I click somewhere else o
$(document).mouseup(function (e) { var container = $("YOUR CONTAINER SELECTOR"); if (!container.is(e.target)&& container.has(e.target).length === 0) { container.hide(); } });