I\'m trying to hide a div if the user clicks anywhere BUT the popup OR its children. This is the code I have so far:
$(\"body\").click(function(){ var $t
$("body").click(function(event ){ var $target = $(event.target); if(!$target.parents().is(".popup") && !$target.is(".popup")){ $("body").find(".popup").hide(); } });
this is the solution for me