How to implement Html event bubbling

一个新手
Release: 2017-10-12 10:33:17
Original
1654 people have browsed it

I originally thought that span was different from input, and event bubbling would be swallowed up by the parent tag. I wrote a demo to test event bubbling, but found that it was not what I thought. In addition: event.stopPropagation() and event.stopImmediatePropagation() cannot prevent span from bubbling into the a tag, but the simple and crudereturn falsecan.


   Bubbling   
  
span tag in div

in div

span tag in anchor
span tag in anchor
Copy after login

The above is the detailed content of How to implement Html event bubbling. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!