js中的鼠標(biāo)事件
在JavaScript中有鼠標(biāo)事件嗎,比如在這節(jié)中,我寫
window.onload=function(){
????var tr=document.getElementsByTagName("tr");
????tr.onmouseover="this.style.backgroundcolor='red'" ? ? ? ? ? //這樣寫對(duì)嗎
}
如上tr.onmouseover="this.style.backgroundcolor='red'" 有這樣的寫法嗎?
2017-01-02
首先onmouseover這個(gè)鼠標(biāo)劃過(guò)事件是有的,但是,這個(gè)時(shí)間觸發(fā)之后是調(diào)用某個(gè)函數(shù),你要把后面的功能寫進(jìn)函數(shù)中去實(shí)現(xiàn),然后,onmouseovre去調(diào)用這個(gè)函數(shù),其它的部分我沒(méi)看。