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

duplicate-id-active

Skill này làm gì

Skill này kiểm tra các phần tử tương tác trên trang, như link, nút và ô nhập, có ID duy nhất hay không. Skill dành cho lập trình viên muốn điều hướng chính xác và đáng tin cậy.

Khi nào nên dùng

  • ✓Khi tiêu điểm bàn phím nhảy sai chỗ trên trang.
  • ✓Khi một nút kích hoạt sai hành động sau khi bạn sao chép một component.
  • ✓Khi bạn rà soát trang để tìm vấn đề truy cập.

Liên kết skill

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/duplicate-id-active/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-active/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 trang của tôi xem có ID trùng lặp trên nút và link 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 ID xuất hiện nhiều lần trên phần tử nhận được tiêu điểm. Nó gợi ý đặt cho mỗi ID một mã duy nhất và cập nhật mọi tham chiếu tới ID đó.

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 active elements

Duplicate IDs on active elements can cause browsers and assistive technologies to skip items, misdirect focus, or fail to trigger the correct action.

Quick Reference

  • Ensure all focusable elements (links, buttons, inputs) have unique id values
  • Avoid duplicate IDs that can break keyboard navigation and focus management
  • Prevent screen reader confusion when navigating interactive controls

Check

Search for duplicate id attributes on focusable or active HTML elements.

Fix

Assign a unique id to each active element to ensure correct focus handling and accessibility.

Explain

Explain how unique IDs on active elements prevent navigation errors for keyboard and screen reader users.

Code Review

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

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

Vì sao ID trùng lặp gây vấn đề?

Trình duyệt và công cụ hỗ trợ có thể chọn nhầm phần tử, khiến bỏ qua mục hoặc kích hoạt sai hành động.

Những phần tử nào được kiểm tra?

Skill tập trung vào các phần tử nhận được tiêu điểm như link, nút và ô nhập.

Làm sao xác nhận đã sửa đúng?

Skill gợi ý kiểm tra bằng 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 active elements. 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
#2824
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ự