Skip to content

Instantly share code, notes, and snippets.

@zwacky
Last active March 1, 2017 12:53
Show Gist options
  • Save zwacky/c41a5725d8ae8d97a17bff0bae566841 to your computer and use it in GitHub Desktop.
Save zwacky/c41a5725d8ae8d97a17bff0bae566841 to your computer and use it in GitHub Desktop.
DOM manipulation without explicitly checking if they exist already in the DOM
// less error prone DOM manipulation
[].filter.call([document.querySelector('.single-selected-class')], item => item)
.forEach(item => item.blur());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment