标签:
var once = function(obj, evtType, handler) { var f = function() { //console.log(arguments) handler.apply(window, arguments) obj.removeEventListener(evtType, f, false) } obj.addEventListener(evtType, f, false) } once(document.querySelector(‘button‘), ‘click‘, function(event) { console.log(event) })
标签:
原文地址:http://www.cnblogs.com/jzm17173/p/4552408.html