Changcolor

 1 <script>    
 2 function changecolor(dom){
 3          dom.style.backgroundColor = "gray";
 4     }
 5     function changeback(dom){
 6         dom.style.backgroundColor = "green";
 7     }
 8 </script>
 9 <style type="text/css">
10     div{
11         width:200px;
12         height:200px;
13         border:1px solid #000;
14         background-color:green;
15     }
16 </style>
17 </head>
18 
19 <body>
20     <div onmouseover = "changecolor(this)" onmouseout = "changeback(this)"> </div>
21 </body>

 

posted @ 2012-07-31 19:47  晓 漪  阅读(184)  评论(0编辑  收藏  举报