Created
December 2, 2019 18:22
-
-
Save RiodeJaneiroo/726b51ee695a7a3fb5ddcd5399209a29 to your computer and use it in GitHub Desktop.
[Click out of the element] jquery #js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(document).on('click',function (e) { | |
var el = '.element'; | |
if (jQuery(e.target).closest(el).length) return; | |
// дальше пишем код который нужно выполнить по клику вне элемента | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment