select-name
它能做什么
这个技能检查表单中每个 select 下拉菜单是否有正确的标签或无障碍名称。它面向希望表单对所有用户都完整可用的开发者。
适用场景
- ✓你请智能体检查表单中下拉菜单的无障碍性的时候。
- ✓屏幕阅读器用户听到一个下拉菜单,却不知道它的用途的时候。
- ✓表单用第一个选项代替标签,而你希望修正这一点的时候。
技能链接
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/select-name/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请帮我检查表单上的每个下拉菜单是否都有屏幕阅读器能读取的正确标签吗?”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会找到每个 select 元素,并检查是否有关联的标签、aria-label 或 aria-labelledby 值。如果都没有,它会添加一个通过 id 与该下拉菜单相连的标签。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Provide accessible names for select elements
Without an accessible name, screen reader users will not know what information the dropdown is asking for, making forms impossible to complete.
Quick Reference
- Use the
<label>element with a matchingforattribute for every<select> - Alternatively, use
aria-labeloraria-labelledbyif a visible label is not possible - Avoid using the first option as a replacement for a proper label
Check
Check that every <select> element in your forms has a valid accessible name or linked label.
Fix
Add a <label> element with a for attribute that matches the id of the <select> tag.
Explain
Explain how accessible names for select elements provide the necessary context for users of assistive technologies.
Code Review
Review the rendered markup and interactive states that affect Provide accessible names for select elements. Flag exact elements, roles, labels, focus behavior, or keyboard interactions that violate the rule, and note how to verify the fix with browser accessibility tooling or assistive tech.
For full implementation details, code examples, and framework-specific guidance,
see references/rule.md.
Rule page: https://frontendchecklist.io/rules/accessibility/select-name
常见问题
下拉菜单为什么需要标签?
没有标签,屏幕阅读器用户就无法知道下拉菜单要求提供什么信息,表单可能根本无法完成。
把第一个选项作为标签好吗?
不好。这个技能说,不应用第一个选项来代替正确的标签。
什么时候使用 aria-label?
这个技能建议在无法显示可见标签时使用它。
详情
作者的原始描述
Use when reviewing rendered HTML, interactive components, or design-system patterns related to Provide accessible names for select elements. Check native semantics first, then inspect keyboard behavior, focus flow, accessible names, and screen-reader output where relevant.
热度
- GitHub 星标
- 75k
- 排名
- #3012
- 许可证
- MIT
- 更新时间
- 2026/10/31
评论
- …
同一仓库的更多技能
frontendchecklist
75k使用命令行工具,依据 380 多条关于无障碍、速度、SEO 和安全的规则,检查前端代码和线上页面。
frontend-checklist-global
75k依据全部 386 条 Front-End Checklist 规则审查前端项目,并为发现的每个问题给出具体修复方法。
404-page
75k检查你的页面缺失提示是否提供有用的链接,并返回真正的 404 状态,帮助迷路的访客找到方向。
about-page
75k审查你的网站是否有清晰的关于页面,说明由谁运营,以建立访客和搜索引擎的信任。