跳到正文
Skillpedia
网站与界面(前端)75k · #2743

aria-valid-attr

它能做什么

这项技能检查页面上每个 aria 属性名称是否真实且属于标准。适合手动编写无障碍标记的开发者。

适用场景

  • ✓当你在 HTML 或模板中输入 aria 属性时。
  • ✓当屏幕阅读器忽略了你添加的某个属性时。
  • ✓当你审查他人编写的代码,检查其中的 ARIA 错误时。

技能链接

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/aria-valid-attr/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/aria-valid-attr/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请在我网站的导航标记中找出拼写错误的 aria 属性,并加以修复。”

每周 5 个新技能,1 分钟读完。

工作原理

智能体会列出每个元素上使用的 aria 属性,并替换所有拼写错误或未在 WAI-ARIA 规范中定义的属性。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Ensure ARIA attributes are valid

Invalid ARIA attributes are ignored by browsers and screen readers, potentially leaving users with disabilities unable to navigate or understand the interface.

Quick Reference

  • Use only valid, standard-defined ARIA attributes
  • Avoid misspelled or non-existent aria-* properties
  • Ensure screen readers correctly interpret element roles and states

Check

Identify any invalid or misspelled ARIA attributes on HTML elements.

Fix

Replace invalid ARIA attributes with their correct names as defined in the WAI-ARIA specification.

Explain

Explain how valid ARIA attributes enable assistive technologies to communicate element state and behavior to users.

Code Review

Review the rendered markup and interactive states that affect Ensure ARIA attributes are valid. 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/aria-valid-attr

常见问题

无效的 ARIA 属性会怎样?

这项技能说明,浏览器和屏幕阅读器会忽略它,因此原本想提供的帮助不会到达用户。

正确的名称来自哪里?

这项技能以 WAI-ARIA 规范作为参考依据。

它也检查属性值吗?

不检查。属性值由单独的检查负责。

详情

作者的原始描述

Use when reviewing rendered HTML, interactive components, or design-system patterns related to Ensure ARIA attributes are valid. Check native semantics first, then inspect keyboard behavior, focus flow, accessible names, and screen-reader output where relevant.

repo: thedaviddias/Front-End-Checklist

热度

GitHub 星标
75k
排名
#2743
许可证
MIT
更新时间
2026/10/31

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能