input-types
它能做什么
这项技能审查表单字段,检查它们是否使用了最合适的 HTML input 类型和 autocomplete 设置。适用于构建注册、结账和联系表单的开发者。
适用场景
- ✓当邮箱或电话字段在手机上显示普通键盘的时候。
- ✓当浏览器无法自动填充姓名、地址或支付字段的时候。
- ✓当你构建新表单,并希望它在手机上易于填写的时候。
技能链接
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/input-types/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请检查我的表单字段,并为移动端设置正确的 input 类型。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会审查每个 input 元素,并建议 email、tel 和 number 等语义化类型。它还会添加 autocomplete 值,使浏览器能够填入已保存的信息。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Use semantic input type attributes
Using type=text for every input forces mobile users to switch keyboards manually for email, phone, and number entry. The correct type also enables browser autofill to correctly identify fields for name, address, and payment data. Combined with autocomplete attributes, semantic types can make form completion 40% faster for returning users.
Quick Reference
- type=email shows the @ keyboard on mobile and enables email format validation
- type=tel shows the numeric phone keypad on mobile
- type=number shows a numeric keypad; use inputmode=numeric for fields that look like numbers but aren't
- type=date/time renders native pickers and returns standardized values
Check
Audit all input elements in this HTML file. Check whether each uses the most appropriate type attribute and autocomplete value.
Fix
Update input type attributes to semantic values and add appropriate autocomplete attributes for autofill support.
Explain
Explain the different HTML input types, what each one does on mobile keyboards, and how to combine them with autocomplete attributes.
Code Review
Review templates, server-rendered HTML, and shared components that output markup related to Use semantic input type attributes. Flag exact elements, attributes, and routes where the rendered HTML violates the rule.
For full implementation details, code examples, and framework-specific guidance,
see references/rule.md.
Rule page: https://frontendchecklist.io/rules/html/input-types
常见问题
在手机上 type email 有什么变化?
这项技能指出,它会显示带有 @ 符号的键盘,并启用邮箱格式检查。
什么时候应使用 inputmode numeric?
这项技能建议用于看起来像数字但并非数字的字段,例如验证码。
它能加快表单填写吗?
这项技能指出,语义化类型配合 autocomplete,可以帮助回访用户更快完成表单。
详情
作者的原始描述
Use when reviewing templates, rendered HTML, or shared components related to Use semantic input type attributes. Validate the final browser-facing markup, not just the source framework abstraction.
热度
- GitHub 星标
- 75k
- 排名
- #2894
- 许可证
- MIT
- 更新时间
- 2026/10/31
评论
- …
同一仓库的更多技能
frontendchecklist
75k使用命令行工具,依据 380 多条关于无障碍、速度、SEO 和安全的规则,检查前端代码和线上页面。
frontend-checklist-global
75k依据全部 386 条 Front-End Checklist 规则审查前端项目,并为发现的每个问题给出具体修复方法。
404-page
75k检查你的页面缺失提示是否提供有用的链接,并返回真正的 404 状态,帮助迷路的访客找到方向。
about-page
75k审查你的网站是否有清晰的关于页面,说明由谁运营,以建立访客和搜索引擎的信任。