Files
charlie f3bdaa4e88 feat: add TypeScript lessons and learning panel
- Introduced a new script to check TypeScript lesson files for errors.
- Created a main TypeScript file to render lessons and their details.
- Added lesson definitions with starter and answer codes.
- Implemented a user interface for navigating and running lessons.
- Styled the application with CSS for a better user experience.
- Updated README to reflect the new TypeScript section and usage instructions.
2026-03-19 10:06:11 +08:00

26 lines
907 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 练习 6冒泡、委托和 stopPropagation
## 目标
理解事件会冒泡,并学会在列表里使用事件委托。
## 你要练什么
- 事件冒泡
- `event.target`
- 事件委托
- `stopPropagation()`
## 任务
- 点击外层面板时输出一条日志
- 点击列表项时,通过事件委托切换激活状态
- 点击列表项里的删除按钮时,阻止冒泡并删除当前项
## 文件
- [starter.html](/Users/lijiaqing/home/wwwroot/front-end-example/04-dom-events-async/06-bubbling-and-delegation/starter.html)
- [starter.js](/Users/lijiaqing/home/wwwroot/front-end-example/04-dom-events-async/06-bubbling-and-delegation/starter.js)
- [answer.html](/Users/lijiaqing/home/wwwroot/front-end-example/04-dom-events-async/06-bubbling-and-delegation/answer.html)
- [answer.js](/Users/lijiaqing/home/wwwroot/front-end-example/04-dom-events-async/06-bubbling-and-delegation/answer.js)