Skip to content

Instantly share code, notes, and snippets.

@kawabataryo
Last active August 29, 2015 14:08
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 kawabataryo/c99d502ed97d85a4fe41 to your computer and use it in GitHub Desktop.
Save kawabataryo/c99d502ed97d85a4fe41 to your computer and use it in GitHub Desktop.
function setEvent(selector,event,func){
var ary = document.querySelectorAll(selector);
var len = ary.length;
for (var i = 0; i < len; i++){
ary[i].addEventListener(event, func);
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment