摘要: 一、this的使用情况1.在html的事件属性中使用this 例如:<input type="button" id="button2" value="button222" onclick="javascript:alert(this.id);" />2.在事件处理函数中使用this例如:button2.onclick = function(){ alert(this.name); }3.如果在全局函数中使用,则this为window对象例如:alert(this == window); //true4. 阅读全文
posted @ 2012-12-06 16:10 沙漠孤鹰1140 阅读(151) 评论(0) 推荐(0) 编辑