UNPKG

light-boilerplate

Version:

Lightweight and powerfull startkit for your next project!

19 lines (14 loc) 367 B
/* bling.js */ window.$ = document.querySelectorAll.bind(document); Node.prototype.on = window.on = function(name, fn) { this.addEventListener(name, fn); }; NodeList.prototype.__proto__ = Array.prototype; NodeList.prototype.on = NodeList.prototype.addEventListener = function( name, fn ) { this.forEach(function(elem, i) { elem.on(name, fn); }); };