Define ids for elements [SC4-1-1-id]

Test info
Possible Results

Test info

Test for Success Criterion 4.1.1

About

Checked Elements: Elements with a defined id attribute
This test checks, if the values of the id attributes are unique.

Short Description

IDs have to be unique. When id attribute values are not unique, they are particularly problematic when referenced by labels, headers in data tables, or used as fragment identifiers, as user agents do not have enough information to determine essential relationships (i.e., to determine which label goes with which item).

How to Repair

IDs are assigned to an element with the id attribute. If an ID is not unique, assign a new, unique ID, having the following syntax: ID tokens.

  • HTML5
    • id must contain at least one character.
    • may not contain any space characters.
  • Others
    • must begin with a letter ([A-Za-z]) and
    • may be followed by
      • any number of letters,
      • digits ([0-9]),
      • hyphens ("-"),
      • underscores ("_"),
      • colons (":"), and
      • periods (".").

Take care, to also update all references to the old ID.

WCAG 2.0

Principle 4: Robust
Content must be robust enough that it can be interpreted reliably by a wide variety of user agents, including assistive technologies.
WCAG 2.0: Principle 4
Guideline 4.1: Compatible
Maximize compatibility with current and future user agents, including assistive technologies.
Understanding Guideline 4.1
Success Criterion 4.1.1: Parsing (Level A)
In content implemented using markup languages, elements have complete start and end tags, elements are nested according to their specifications, elements do not contain duplicate attributes, and any IDs are unique, except where the specifications allow these features. Note: Start and end tags that are missing a critical character in their formation, such as a closing angle bracket or a mismatched attribute value quotation mark are not complete.
Understanding: Success Criterion 4.1.1
Techniques

Possible Results

Failed The id is not unique

The ID of this element has occurred before on this page

Passed The ID is valid

The value of the id attribute is unique and syntactically correct.