this指触发事件的对象
<input id="myinput" type="text" value="javascript中onclick中的this" οnclick="javascript:test(this);"/>
function test(obj){
alert(obj);
//[object HTMLInputElement]
alert(obj.id);
//myinput
alert(obj.value);
//javascript中onclick中的this
}
最后
以上就是活力仙人掌最近收集整理的关于javascript中onclick(this)的全部内容,更多相关javascript中onclick(this)内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复