Skip to content

Instantly share code, notes, and snippets.

@jtulk
Created August 10, 2015 17:46
Show Gist options
  • Save jtulk/10771bf9038ed1314db4 to your computer and use it in GitHub Desktop.
Save jtulk/10771bf9038ed1314db4 to your computer and use it in GitHub Desktop.
Example #3: Rewriting jQuery's .each() in Vanilla JS
// Attach focus & blur handlers to the first selected input
inputs[0].addEventListener('focus', textInputFocusHandler);
inputs[0].addEventListener('blur', textInputBlurHandler);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment