首页 > 其他 > 详细

event chrome firefox

时间:2017-03-02 12:40:41      阅读:275      评论:0      收藏:0      [点我收藏+]

 技术分享

 

技术分享

 

技术分享

 

技术分享

w

0-目前的解决办法,使用jquery

技术分享

 

技术分享

<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
</head>
<body>
<p onclick="w()" id="wid" class="wclass">www</p><br>

<p onclick="wb()" id="widb" class="wclassb">wwwb</p>
</body>
</html>
<script>
    function w() {
        console.log(event);
        console.log(event.target);
        console.log(event.target.getAttribute(id));
        console.log(event.target.getAttribute(class));
    }
    function wb() {
        var event = window.event
        console.log(event);
        console.log(event.target);
        console.log(event.target.getAttribute(id));
        console.log(event.target.getAttribute(class));
    }
</script>

 

https://developer.mozilla.org/en-US/docs/Web/API/Event

  1. MDN
  2.  
  3. Web technology for developers
  4.  
  5. Web APIs
  6.  
  7. Event

 

The Event interface represents any event which takes place in the DOM; some are user-generated (such as mouse or keyboard events), while others are generated by APIs (such as events that indicate an animation has finished running, a video has been paused, and so forth). There are many types of event, some of which use are other interfaces based on the main Event interface. Event itself contains the properties and methods which are common to all events.

event chrome firefox

原文:http://www.cnblogs.com/yuanjiangw/p/6489731.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!