请教一个小问题~
来源:百度知道 编辑:UC知道 时间:2024/05/31 10:10:51
onMouseOver="this.bgColor='#666666'" onMouseOut="this.bgColor='#333333'"
上面的代码为什么只在表格TD里起效呢?我想在DIV或别的元素内也可以,代码该怎么写?
上面的代码为什么只在表格TD里起效呢?我想在DIV或别的元素内也可以,代码该怎么写?
因为div没有bgcolor的属性。所以不能用在div里面。
要用的话只能用css。
<div onMouseOver="this.style.backgroundColor='#666666'" onMouseOut="this.style.backgroundColor='#333333'">中华人民共和国</div>
onMouseOver="this.style.backgroundColor='#666666'"
onMouseOut="this.style.backgroundColor='#333333'"
div不支持bgColor