鼠标移动到、移出DIV时修改DIV的颜色:
1.Change the font and Div background color--function
<div style="width:200px;height:200px;border:1px solid #ccc;color:#555" οnmοuseοver="size()" οnmοuseοut="size1()" id="d1"> sajdaskjdaslkj </div> <script language="javascript">
function size(){
document.getElementById("d1").style.color = "red"/*修改字体颜色*/
document.getElementById("d1").style.backgroundColor = "red"/*修改背景颜色*/
}
function size1(){
document.getElementById("d1").style.color = "#888"/*修改字体颜色*/
document.getElementById("d1").style.backgroundColor = "red"/*修改背景颜色*/
}
</script>
2.Change the font and Div background color
<DIV style="BACKGROUND-COLOR: #fcc" id=leftOuthosRecord class=labeldiv οnmοuseοver="javascript:this.style.backgroundColor='blue';" οnmοuseοut="javascript:this.style.backgroundColor='#CCC'" οnclick="HiddendivContent('#rightOuthosRecord','#leftOuthosRecord','#CCC')">TEST</DIV>