본문으로 건너뛰기
Skillpedia
웹사이트 및 UI (프런트엔드)75k · #3069

unique-id

하는 일

이 스킬은 웹 페이지의 모든 id가 한 번만 쓰였는지 확인합니다. 레이블이 깨지거나 스크립트가 엉뚱한 요소를 잡는 문제를 보는 개발자를 위한 스킬입니다.

사용하는 경우

  • ✓같은 id가 두 개 이상의 요소에 쓰인 페이지.
  • ✓양식 레이블이나 ARIA 연결이 입력란과 이어지지 않을 때.
  • ✓컴포넌트 라이브러리가 중복 ID를 만들었을 수 있을 때.

스킬 링크

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

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

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.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“이 컴포넌트를 한 페이지에 두 번 쓰면 양식 레이블이 동작하지 않습니다. 중복된 ID가 있는지 확인해 주실 수 있나요?”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

에이전트는 페이지에서 반복되는 id 값을 찾습니다. 그다음 각 요소에 고유한 id를 주고, 이를 참조하는 레이블, ARIA 참조, 스크립트를 업데이트합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 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

자주 묻는 질문

중복 ID가 왜 문제인가요?

양식 레이블, 접근성 연결, getElementById 호출을 깨뜨려 조용한 버그를 만들 수 있습니다.

스타일링에도 ID를 써야 하나요?

이 스킬은 스타일에는 클래스를 쓰고, ID는 고유한 앵커와 참조에만 쓰라고 제안합니다.

컴포넌트 라이브러리가 이런 문제를 만들 수 있나요?

네. 이 스킬은 컴포넌트 라이브러리가 중복을 만들 수 있다고 말합니다.

상세 정보

작성자의 원본 설명

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

인기도

GitHub 스타
75k
순위
#3069
라이선스
MIT
업데이트
2026. 10. 31.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬