JavaScript事件--鼠标移上或离开会变色

Original 2019-03-28 11:40:41 357
abstract:<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>js</title> <style>         .box{  
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>js</title>
<style>
        .box{
         width:400px;
         height:400px;
         border:1px solid #ccc;
         background:pink;
         border-radius:200px;
         margin:100px auto;
        } 
</style>
</head>
<body>
<div class="box" onmouseover="myimg(this)" onmouseout="img(this)">
</div>

<script>
            function myimg(x){
         x.style.background="blue";
           }
           function img(y){
         y.style.background="pink";
           }

</script>
</body>
</html>

总结:事件的简单了解还是不错的,需要我们多加练习!

Correcting teacher:查无此人Correction time:2019-03-28 13:21:22
Teacher's summary:完成的不错。js事件有很多,记住一些常用的就行了。继续加油。

Release Notes

Popular Entries