We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
<div id="outer"> <div id="inner">inner</div> </div>
标准的事件流是怎样的?
标准的事件流是:根节点(document/html) --> 向下捕获 --> 目标元素 --> 向上冒泡到根节点(document/html)
也就是说,标准的事件流,遵循的是事件捕获
如果一个标签没有子标签,分别给该节点设置捕获和冒泡事件时,事件响应的先后顺序是怎样的?
谁在前,先响应谁
兼容写法
标准浏览器:
dom.addEventListener('click', function() {}, false);
其中,第三个参数,如果为 true,则为捕获;否则为冒泡。
true
IE 浏览器(10-)
dom.attachEvent('onclick', function() {})
这个方法在 IE11 已经被废弃
The text was updated successfully, but these errors were encountered:
No branches or pull requests
标准的事件流是怎样的?
标准的事件流是:根节点(document/html) --> 向下捕获 --> 目标元素 --> 向上冒泡到根节点(document/html)
也就是说,标准的事件流,遵循的是事件捕获
如果一个标签没有子标签,分别给该节点设置捕获和冒泡事件时,事件响应的先后顺序是怎样的?
谁在前,先响应谁
兼容写法
标准浏览器:
其中,第三个参数,如果为
true
,则为捕获;否则为冒泡。IE 浏览器(10-)
这个方法在 IE11 已经被废弃
The text was updated successfully, but these errors were encountered: