owpgcw
Last Updated: February 25, 2016
·
1.038K
· novalagung
16162fed91387cc1cec055412db0022d

Javascript - Creating jQuery-like selector and event add listener

var $ = document.querySelectorAll.bind(document);
Element.prototype.on = Element.prototype.addEventListener;

$('#somelink')[0].on('touchstart', handleTouch);
Say Thanks
Respond