欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

javascript中onclick(this)用法介紹

 更新時(shí)間:2013年04月19日 17:20:17   作者:  
this指觸發(fā)事件的對(duì)象,接下來(lái)為大家分享下javascript中onclick(this)的用法,感興趣的朋友可以參考下哈,希望對(duì)你有所幫助
this指觸發(fā)事件的對(duì)象
復(fù)制代碼 代碼如下:

<input id="myinput" type="text" value="javascript中onclick中的this" onclick="javascript:test(this);"/>

復(fù)制代碼 代碼如下:

function test(obj){
alert(obj); //[object HTMLInputElement]
alert(obj.id); //myinput
alert(obj.value); //javascript中onclick中的this
}

相關(guān)文章

最新評(píng)論