jQuery click anywhere in the page except specific div

$(‘body’).click(function(evt){
if(evt.target.id == “my_except_div”)
return;

if($(evt.target).closest(‘#my_except_div’).length)
return;

//Set your code to continue it.
alert(‘Click fire except my_except_div’);
});

Leave a comment