Why not just get the arguments from the target attribute of the event?(为什么不仅仅从事件的target属性获取参数?)
Example:(例:)
var someInput = document.querySelector('input');
someInput.addEventListener('click', myFunc, false);
someInput.myParam = 'This is my parameter';
function myFunc(evt)
{
window.alert(evt.currentTarget.myParam);
}
JavaScript is a prototype-oriented language, remember!(JavaScript是一种面向原型的语言,请记住!) 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…