87,907
社区成员
发帖
与我相关
我的任务
分享
<input type="text" onblue="alert(this.value);" />
//this 当前对象
<script>
var test=function(obj){
alert(obj.valued+obj.name);
};
</script>
<input type="text" onclick="test(this)"/>
var demo = {
fn: function(){ alert(this.name);},
name: 'this is demo'
};
demo.fn(); // 'this is demo'
<input type="text" onblue="alert(this.value);" />
///////this 就是当前对象,同时可以这样,
<script>
var test=function(el){
alert(el.value);
};
</script>
<input type="text" onblue="alert(this);" />