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
d5ff59ac76b024e48cb319376745ae669ac4c30e
front-end-example
/
04-dom-events-async
/
04-click-counter
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
练习 4
:
点击计数器
目标
学会给按钮绑定点击事件,并更新页面数据。
你要练什么
addEventListener
点击事件
数字状态更新
DOM 渲染
任务
点击加一按钮时计数加 1
点击减一按钮时计数减 1
点击重置按钮时恢复为 0
文件
starter.html
starter.js
answer.html
answer.js