Principle 4: Robust - Content must be robust enough that it can be interpreted reliably by a wide variety of user agents, including assistive technologies.
Guideline 4.1 Compatible
Maximize compatibility with current and future user agents, including assistive technologies.
This guideline is mainly for the benefit of developers as it is concerned with the code construction of a web page. As well as following standards it is important that the code be as clean as possible. Even though some constructs and techniques may be valid and meet the standards they may not necessarily be conducive for use by a user agent. For Success Criterion 4.1.1 it is mainly concerned with what I would consider the expected way of writing HTML, that is, it should be valid and well-formed. Success Criterion 4.1.2 also looks at the techniques available for the use of certain elements and attributes
4.1.1 Parsing: 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. [Level A]
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.
Much of this criterion might seem obvious but there are still a great many web pages which don't adhere to the rules. Validation of web pages uncovers many of these issues, often accidental rather than deliberate, and so successul validation is vital.
4.1.2 Name, Role, Value: For all user interface components (including but not limited to: form elements, links and components generated by scripts), the name and role can be programmatically determined; states, properties, and values that can be set by the user can be programmatically set; and notification of changes to these items is available to user agents, including assistive technologies. [Level A]
Note: This success criterion is primarily for Web authors who develop or script their own user interface components. For example, standard HTML controls already meet this success criterion when used according to specification.
This criterion provides assistive technologies the ability to gather information, set or keep up to date with the status of user-interface controls. This is straightforward when using standard technologies but if custom controls are created or interface elements are programmed to have a different role or function then additional measures need to be taken to ensure that the controls provide important information to assistive technologies and allow themselves to be controlled by assistive technologies.