Chuyển đến nội dung
Skillpedia
Website và giao diện (frontend)75k · #2825

duplicate-id-aria

Skill này làm gì

Skill này kiểm tra các tham chiếu nhãn ARIA trên trang có trỏ tới mục tiêu duy nhất hay không. Skill dành cho lập trình viên muốn đầu ra của trình đọc màn hình chính xác.

Khi nào nên dùng

  • ✓Khi trình đọc màn hình đọc sai nhãn của một điều khiển.
  • ✓Khi bạn sao chép một component dùng aria-labelledby hoặc thuộc tính tương tự.
  • ✓Khi bạn rà soát khả năng truy cập của các phần lặp lại trên trang.

Liên kết skill

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

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/duplicate-id-aria/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Bạn có thể kiểm tra xem nhãn ARIA của tôi có trỏ đúng tới phần tử không?”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Agent tìm các thuộc tính ARIA có ID được tham chiếu xuất hiện nhiều lần. Nó gợi ý làm mỗi ID duy nhất và cập nhật các tham chiếu tương ứng.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

Use unique IDs for ARIA references

When ARIA attributes point to duplicate IDs, assistive technologies may read the wrong label or description, providing misleading information to the user.

Quick Reference

  • Ensure IDs referenced by ARIA attributes (e.g., aria-labelledby) are unique
  • Avoid duplicate IDs that lead to ambiguous accessibility relationships
  • Verify that ARIA controls correctly target their intended elements

Check

Identify elements where an ARIA attribute references an id that appears multiple times in the DOM.

Fix

Ensure all elements referenced by ARIA attributes have unique IDs and update the references accordingly.

Explain

Explain how unique IDs are essential for establishing reliable relationships between ARIA attributes and their targets.

Code Review

Review the rendered markup and interactive states that affect Use unique IDs for ARIA references. 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/duplicate-id-aria

Câu hỏi thường gặp

aria-labelledby là gì?

Đó là thuộc tính cho công cụ hỗ trợ biết phần tử nào cung cấp tên cho một phần tử khác.

ID trùng lặp gây hại gì ở đây?

Trình đọc màn hình có thể đọc nhãn từ sai chỗ, đưa ra thông tin gây hiểu lầm.

Kết quả nên được xác minh bằng cách nào?

Skill gợi ý công cụ truy cập của trình duyệt hoặc công nghệ hỗ trợ.

Chi tiết

Mô tả gốc của tác giả

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

repo: thedaviddias/Front-End-Checklist

Độ phổ biến

Sao GitHub
75k
Vị trí xếp hạng
#2825
Giấy phép
MIT
Cập nhật
31/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự