我是一个javascript新手,我想实现 在浏览器运行时,把鼠标箭头移动或移开到“北京”时,“北京”的颜色发生改变,但我做的不能够实现,请教下高手
<html>
<head>
<title>css的示例</title>
<script type="text\javascript">
function changes1()
{
document.getElementById("news").style.color="rgb(0,255,0)";
}
function changes2()
{
document.getElementById("news").style.color="rgb(255,0,0)";
}
</script>
</head>
<body>
<p id="news" class="" onmouseout="changes1()" onmouseover="changes2()">北京</p>
</body>
</html>
<html>
<head>
<title>css的示例</title>
<script type="text\javascript">
function changes1()
{
document.getElementById("news").style.color="rgb(0,255,0)";
}
function changes2()
{
document.getElementById("news").style.color="rgb(255,0,0)";
}
</script>
</head>
<body>
<p id="news" class="" onmouseout="changes1()" onmouseover="changes2()">北京</p>
</body>
</html>
<html>
<head>
<title>css的示例</title>
<script type="text/javascript">
function changes1()
{
document.getElementById("news").style.color="rgb(0,255,0)";
}
function changes2()
{
document.getElementById("news").style.color="rgb(255,0,0)";
}
</script>
</head>
<body>
<p id="news" class="" onmouseout="changes1()" onmouseover="changes2()">北京</p>
</body>
</html>