1. 首页
  2. 数据库
  3. 其它
  4. 如何使用Javascript中的this关键字

如何使用Javascript中的this关键字

上传者: 2020-12-23 05:23:28上传 PDF文件 78KB 热度 18次
一、基本的: 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();}//
用户评论