Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

click outside element jquery

    $(document).click(function (event) {
        var $target = $(event.target);
        if (!$target.closest('.modal-dialog').length && $('.modal-dialog').is(":visible")) {
            console.log("clicked outside the element")
        }
    });
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #click #element #jquery
ADD COMMENT
Topic
Name
3+3 =