Last active
October 5, 2020 18:48
-
-
Save mrtag23/84c088805dd658584ad0538afd4a545d to your computer and use it in GitHub Desktop.
Detects focusing out of a container.
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
$(function(){ | |
var wrapper = document.getElementsByClassName('thewrapper')[0]; | |
wrapper.addEventListener('focusout', function(event) { | |
if (wrapper.contains(event.relatedTarget)) { | |
return; | |
} | |
console.log('out of the wrapper'); | |
}); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment