<!DOCTYPE html"> <head> <title>无标题文档</title> <body> </head> <div style="background:#FC0; padding:30px 100px" id = 'outer' onclick="alert('外')" "> <div style="color:#FFF; background:#09F; padding:5px 20px" id = 'core' > 内</div> </div> </body> <script type = 'text/javascript'> var core = document.getElementById('core'); core.addEventListener("click", function(e) { alert('内'); e.stopPropagation(); }, false); </script> <html>
标签:core,无标题,HTML,冒泡,67,阻断 From: https://www.cnblogs.com/tulater/p/17767575.html