document.addEventListener
来源:互联网 发布:淘宝卖家申请蚂蚁花呗 编辑:程序博客网 时间:2024/05/27 16:40
addEventListener
is used to add event handler to DOM element. There are three phases in the process of an event on browser: capture phase, target phase and bubbling phase.
When user click on the web page, the event propagates from window to the target’s parent first, which is the capture phase. Then the event arrives at the target element, which is the at-target phase. Finally, the event propagates through its ancestors till the window. This phase is the bubbling phase.
If set useCapture
option, then the event will be captured on the capture phase, the event handler binding on the ancestor of the event target will be fired before propagated to the target element.
You can use stopPropagation
to stop the event from propagating to the descendants of the element which calls stopPropagation
at capture phase, or propagating to the ancestors of the element which calls the function.
- document.addEventListener
- document.addEventListener理解
- document.addEventListener理解
- document.addEventListener理解
- document.addEventListener 事件的最后一个参数
- document.addEventListener 事件的最后一个参数
- addEventListener
- addEventListener
- addEventListener
- addEventListener
- addEventListener
- addEventListener
- addEventListener
- addEventListener
- addEventListener
- attachEvent() / addEventListener()
- attachEvent() / addEventListener()
- addEventListener事件
- CSS浮动的原理
- 安装windows server系统提示“无法在此驱动器上安装windows”的解决办法
- 维护篇 16. 移置配置文件 ❀ 飞塔 (Fortinet) 防火墙
- 打造便捷win工作环境
- soapui中文操作手册(八)----Web服务的功能测试案例
- document.addEventListener
- 《Python入门》笔记
- 小希的迷宫 HDU
- NSNSPredicate详解
- HDU 2031数制转换
- sonarqube的安装
- 【A ByteOf Python2.7】第4章 基本概念
- php学习——css复习四(理解元素div)
- spring-websocket 运行问题