动画事件的处理

原创 2019-08-17 23:15:46 1486
摘要:<!DOCTYPE html><html lang="en"><head>   <meta charset="UTF-8">   <meta name="viewport" content="width=device-width, in

<!DOCTYPE html>

<html lang="en">

<head>

   <meta charset="UTF-8">

   <meta name="viewport" content="width=device-width, initial-scale=1.0">

   <meta http-equiv="X-UA-Compatible" content="ie=edge">

   <title>Document</title>

</head>

<body>

   <script>

      function myfovus(x){

          x.style.background='yellow'

      }

      function onlick(y){

          y.style.borderRadius="50px"

      }

   </script>

   姓名:<input type="text" onfocus="myfovus(this)">

   <br>

   <br>

   <div style="width: 200px;height: 200px;border:1px solid black" onclick="onlick(this)"></div>

</body>

</html>


批改老师:天蓬老师批改时间:2019-08-19 09:35:07
老师总结:通过属性添加事件, 并不符合dom2标准, 推荐使用addEventListner

发布手记

热门词条