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
/
05-form-submit-and-prevent-default
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
练习 5
:
表单提交和 preventDefault
目标
学会拦截表单默认提交,并把输入内容渲染到页面。
你要练什么
submit
事件
preventDefault()
表单值读取
动态追加列表项
任务
提交表单时阻止页面刷新
读取输入框内容
把内容加入到待办列表
提交后清空输入框
文件
starter.html
starter.js
answer.html
answer.js