<!DOCTYPE html>
<htmlhead>
meta charset="utf-8"title>闭包经典例子详解——huansky</bodydiv id="ttt">
p >000000000000000000p>
br>111111111111111111>222222222222222222divscript>
var dom=document.getElementsByTagName("p);
for( i0;i<dom.length;i++){
dom[i].onclickfunction(){
console.log(i);//3
};
}
>