Answers for "check event target jquery outside"

0

check event target jquery outside

$(document).on("click", function (event) {
  // If the target is not the container or a child of the container, then process
  // the click event for outside of the container.
  if ($(event.target).closest("#container").length === 0) {
    console.log("You clicked outside of the container element");
  }
});
Posted by: Guest on March-31-2021

Code answers related to "check event target jquery outside"

Code answers related to "Javascript"

Browse Popular Code Answers by Language