javascript鼠标移出事件!
我做了一个非常简单的javascript代码,但是为什么鼠标移出后没有改变成绿色呢!<!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Tran...
我做了一个非常简单的javascript代码,但是为什么鼠标移出后没有改变成绿色呢!
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>1</title>
<style type="text/css">
div{width:200px;height:125px;background:black;}
</style>
<script type="text/javascript">
function yi(){document.getElementById("box").style.background="red";}
function yi2(){document.getElementById("box").style.background="green";}
</script>
</head>
<body>
<div id="box" onmouseover="yi()";onmouseout="yi2()";></div>
</body>
</html> 展开
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>1</title>
<style type="text/css">
div{width:200px;height:125px;background:black;}
</style>
<script type="text/javascript">
function yi(){document.getElementById("box").style.background="red";}
function yi2(){document.getElementById("box").style.background="green";}
</script>
</head>
<body>
<div id="box" onmouseover="yi()";onmouseout="yi2()";></div>
</body>
</html> 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询