如何使用Javascript中的this关键字
一、基本的: function doSomething(){ alert(this.id); } alert(window.doSomething);//证明了doSomething是属于window的 doSomething();//undefined [removed] = function(){ document.getElementById("div2").onclick = doSomething;//div2 document.getElementById("div3").onclick = function(){doSomething();}//
下载地址
用户评论