哪里错了,求问?

<!DOCTYPE HTML>

<html>
<head>
    <meta charset="utf-8" />
    <title>js2</title>
    <style type="text/css">
        #div1 {width:300px;
               height:300px;
               background:blue;
        }
    </style>
    <script>
    function toGreen()
    {var change=document.getElementById('div1');
    change.style.width='400px';
    change.style.height='400px';
    change.style.background='green';
    }
    function toBlue()
    {var change=document.getElementById('div1');
    change.style.width='300px';
    change.style.height='300px';
    change.style.background='blue';
    }
    </script>
</head>
<body>
<div id="div1" onmouseover="toGreen" onmouseout="toBlue">
</div>
</body>
</html>
阅读 1.6k
2 个回答
<div id="div1" onmouseover="toBlue()" onmouseout="toGreen()">
var change = event.currentTarget;

onmouseover="toBlue()" onmouseout="toGreen()"

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题