将鼠标移到DIV上变大背景色变成红色,移开后背景色成黑色变小

原创 2018-11-12 22:03:18 321
摘要:<!DOCTYPE html><html><head> <meta charset="UTF-8"> <title>Document</title></head><script type="text/javascript"> func

QQ图片20181112215903.pngQQ图片20181112215917.pngQQ图片20181112215924.png<!DOCTYPE html>
<html>
<head>
 <meta charset="UTF-8">
 <title>Document</title>
</head>
<script type="text/javascript">
 function mymouse(x){
  x.style.background="red";
  x.style.width="200px";
  x.style.height="200px";
 }
 function mymouseout(y){
  y.style.background="#000";
  y.style.width="100px";
  y.style.height="100px";
 }</script>
<body>
 <div style="width: 100px;height: 100px;border: 1px solid #000;margin: 100px;" onmousemove="mymouse(this)" onmouseout="mymouseout(this)">
   
 </div>
</body>
</html>

批改老师:灭绝师太批改时间:2018-11-13 09:24:16
老师总结:完成的不错,学习到后期会越来精彩……继续加油……

发布手记

热门词条