Skip to content

Instantly share code, notes, and snippets.

@LeoLopesWeb
Created September 18, 2023 20:24
Show Gist options
  • Save LeoLopesWeb/ce0f44f17707e0fb9b58566f63dd91aa to your computer and use it in GitHub Desktop.
Save LeoLopesWeb/ce0f44f17707e0fb9b58566f63dd91aa to your computer and use it in GitHub Desktop.
$(document).on("click", function(event) {
var obj = $("#container");
if (!$(event.target).closest(obj).length) {
alert("Outside click detected!");
}
else {
alert("Inside click detected!");
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment