This website requires JavaScript.
Explore
Help
Register
Sign In
rou
/
front-end-example
Watch
1
Star
0
Fork
0
You've already forked front-end-example
Code
Issues
Pull Requests
Actions
Packages
Projects
Releases
Wiki
Activity
Files
1071f4db05cf49802c49ac5497cfc749f5c06a9d
front-end-example
/
04-dom-events-async
/
06-bubbling-and-delegation
History
rou
1071f4db05
update
2026-03-23 14:56:04 +08:00
..
answer.html
feat: add TypeScript lessons and learning panel
2026-03-19 10:06:11 +08:00
answer.js
feat: add TypeScript lessons and learning panel
2026-03-19 10:06:11 +08:00
README.md
feat: add TypeScript lessons and learning panel
2026-03-19 10:06:11 +08:00
starter.html
feat: add TypeScript lessons and learning panel
2026-03-19 10:06:11 +08:00
starter.js
update
2026-03-23 14:56:04 +08:00
README.md
Unescape
Escape
练习 6
:
冒泡、委托和 stopPropagation
目标
理解事件会冒泡,并学会在列表里使用事件委托。
你要练什么
事件冒泡
event.target
事件委托
stopPropagation()
任务
点击外层面板时输出一条日志
点击列表项时,通过事件委托切换激活状态
点击列表项里的删除按钮时,阻止冒泡并删除当前项
文件
starter.html
starter.js
answer.html
answer.js