wwzlhx

17.JS代码中的鼠标事件

鼠标点击:onclick

鼠标按下:onmousedown

鼠标移入:onmouseenter

鼠标离开:onmouseleave

 

onclick事件用法:(其它三个事件与此事件用法相似)

在控制台:document.getElementById("kw").onclick=function(){alert('点击事件执行了')}

在Uibot中代码:function(){document.getElementById("kw").onclick=function(){alert('点击事件执行了')};return 123}

若想清除点击事件代码为:

document.getElementById("kw").onclick=null

posted on 2022-09-29 16:00  轵城  阅读(62)  评论(0)    收藏  举报

导航