var add_the_handlers = function (nodes) {
var helper= function (i) {
return function (e) { alert(i);};};var i;
for (i = 0; i < nodes.length; i += 1) { nodes[i].onclick =helper(i); }};
本文共 242 字,大约阅读时间需要 1 分钟。
var add_the_handlers = function (nodes) {
var helper= function (i) {
return function (e) { alert(i);};};var i;
for (i = 0; i < nodes.length; i += 1) { nodes[i].onclick =helper(i); }};
转载于:https://www.cnblogs.com/dingyuanxin/p/4067128.html