首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > JavaScript >

用js兑现鼠标移出移进变换颜色

2013-03-01 
用js实现鼠标移出移进变换颜色htmlheadmeta charsetutf-8/scriptfunction a(){var reddocumen

用js实现鼠标移出移进变换颜色
<html>
<head>
<meta charset="utf-8"/>
<script>
function a(){
var red=document.getElementById('div1');
red.style.backgroundColor="blue";
}
function b(){
var red=document.getElementById('div1');
red.style.backgroundColor="red";
}
</script>
</head>
<body >
<div id="div1" style="width:120px;height:120px;background-Color:'red';"  onmouseover="a()" onmouseout="b()"></div>
</body>
</html>

热点排行
Bad Request.