Skip to content

Instantly share code, notes, and snippets.

@diewland
Last active June 25, 2019 11:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save diewland/028a4b8a54f7b0c04c38b90fc634872d to your computer and use it in GitHub Desktop.
Save diewland/028a4b8a54f7b0c04c38b90fc634872d to your computer and use it in GitHub Desktop.
Find onblur next target
/* https://stackoverflow.com/a/11544685/466693 */
// focus on first element
$('.my-text').eq(0).focus();
// onblur event
$('.my-text').blur(function (event) {
// do onblur stuff
// ...
// find next target
setTimeout(function(){
console.log('next target is', document.activeElement);
}, 1);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment