function myFun(){for(var i = 0; i < 100; i++){var myDiv = document.createElement("div");myDiv.onclick=function(){alert(this);}; //实现点击myDiv,获得当前点击磨姿的Div. this就是该div}}
<橘猛head>