In this case, if the menu hasnt been opened yet, theres no reason to listen for a click outside of the menu. The user click on the div, this then reveals another larger div displaying more information giving the effect of the box expanding or dropping down. Javascript -- how to click anywhere on page to hide opened div. There's my JavaScript/JQuery var $dropdown = $('.dropdown-content'); $(".dropdown-label").click(function(e){ var $drop = $(this).toggleClass('dropdown--active').find(".dropdown-content").stop(true).toggle(100); $dropdown.not($drop).stop(true).hide(100); return false; }); That div should be hidden if the user clicks To display or hide a
by a