哪里错了,求问?

<!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>


MM们
浏览 501回答 1
1回答

慕神8447489

<div&nbsp;id="div1"&nbsp;onmouseover="toBlue()"&nbsp;onmouseout="toGreen()">var&nbsp;change&nbsp;=&nbsp;event.currentTarget;
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript