Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add warning for HTML files that one or more HTML elements uses the same id attribute value in a HTML file #4706

Closed
lulunac27a opened this issue Feb 9, 2025 · 1 comment
Labels
feat New feature or enhancement linting Axe-linter issues ungroomed Ticket needs a maintainer to prioritize and label

Comments

@lulunac27a
Copy link

Product

axe Linter

Feature Description

HTML elements can only have one id attribute value for the whole HTML file.
For example, the following doesn't meet the requirements:

<div id="content">
  <span id="content">content</span>
</div>
@lulunac27a lulunac27a added feat New feature or enhancement ungroomed Ticket needs a maintainer to prioritize and label labels Feb 9, 2025
@github-actions github-actions bot added the linting Axe-linter issues label Feb 9, 2025
@straker
Copy link
Contributor

straker commented Feb 10, 2025

Thanks for the issue. Axe-core use to have a rule called duplicate-id that did this, but we deprecated it as just having duplicate id's on the page doesn't cause any accessibility problems. It's only when those id's are used in ARIA attributes that cause problems. As such, I don't think we'll support this in axe-linter for the same reason.

@straker straker closed this as completed Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat New feature or enhancement linting Axe-linter issues ungroomed Ticket needs a maintainer to prioritize and label
Projects
None yet
Development

No branches or pull requests

2 participants