Skip to content
Skillpedia
Websites & UI (frontend)75k · #3069

unique-id

What it does

This skill checks that every id on a web page is used only once. It is for developers who see broken labels or scripts that pick up the wrong element.

When to use it

  • ✓When a page has the same id on more than one element.
  • ✓When form labels or ARIA links do not connect to their fields.
  • ✓When a component library may have created duplicate IDs.

Skill link

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

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/unique-id/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute →

Example of what to ask your AI

“My form labels stop working when I use this component twice on a page. Can you check for duplicate IDs?”

5 new skills a week. 1 minute to read.

How it works

The agent scans the page for repeated id values. It then gives each element a unique id and updates the labels, ARIA references and scripts that use them.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

Ensure all IDs are unique

Duplicate IDs break form accessibility (labels don't connect), ARIA relationships fail, and JavaScript getElementById returns wrong elements—causing silent bugs.

Quick Reference

  • Each ID must appear only once per HTML document
  • Use classes for styling, IDs for unique anchors/references
  • Check for duplicates introduced by component libraries
  • Duplicate IDs break form labels, ARIA, and getElementById

Check

Scan this HTML document to ensure all ID attributes are unique across the entire page and properly reference related elements.

Fix

Remove duplicate ID values, ensure each ID is used only once per page, and update any references like labels, ARIA attributes, or JavaScript selectors.

Explain

Explain why unique IDs are essential for HTML validity, accessibility (form labels, ARIA), JavaScript functionality, and CSS styling.

Code Review

Review templates, server-rendered HTML, and shared components that output markup related to Ensure all IDs are unique. 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/unique-id

FAQ

Why do duplicate IDs matter?

They break form labels, accessibility links and getElementById calls, which can cause silent bugs.

Should I use IDs for styling?

The skill suggests using classes for styling, and IDs only for unique anchors and references.

Can component libraries cause this?

Yes. The skill says duplicates can be introduced by component libraries.

Details

Original description by the author

Use when reviewing templates, rendered HTML, or shared components related to Ensure all IDs are unique. Validate the final browser-facing markup, not just the source framework abstraction.

repo: thedaviddias/Front-End-Checklist

Popularity

GitHub stars
75k
Ranking position
#3069
License
MIT
Updated
10/31/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills