Hide div when click outside of same div using jquery
$(".button").click(function(e){ $("div").show(); e.stopPropagation(); }); $("div").click(function(e){ e.stopPropagation(); }); $(document).click(function(){ $("div").hide(); });