event.srcElement+表格应用
2018-09-21 21:39
阅读:604
<scriptlanguage=JavaScript1.2>
functionchangeto(highlightcolor){
source=event.srcElement
if(source.tagName==TRsource.tagName==TABLE)
return
while(source.tagName!=TD)
source=source.parentElement
if(source.style.backgroundColor!=highlightcolor&&source.id!=ignore)
source.style.backgroundColor=highlightcolor
}
functionchangeback(originalcolor){
return
if(event.toElement!=source)
source.style.backgroundColor=originalcolor
}
</script>
<tableonMouseOver=changeto(white)onMouseOut=changeback(#999999)>
评论
亲,登录后才可以留言!