# VGAR Page Requirements

## Valid Code (PAG-WEB-001)

### Write valid HTML or at least well-formed code

Document structure and semantics are important to ensuring assistive technology (AT) properly parses code so it can communicate correct information to users. Using well-formed HTML is the first step towards ensuring the accessibility of a web page or application for AT users.

### Requirements

#### Valid Code (PAG-WEB-001-01)

An automated HTML validation tool does not return any issues related to incomplete start and end tags, improperly nested elements, or duplicate IDs and/or attributes.

### Test Procedures

#### HTML Validator (PAG-WEB-001-01-T)

1. Open About the Nu HTML Checker < [https://validator.w3.org/nu/about.html](https://validator.w3.org/nu/about.html "Follow link") > in a new browser window.
2. Add these two bookmarklets to your browser bookmarks:
   1. Check serialized DOM of current page: grabs the serialized DOM of whatever page you’re currently browsing and sends it to the checker
   2. Check for WCAG 2.0 parsing compliance: filters checker results to just show messages relevant to [requirements in the WCAG 2.1 spec](https://developer.paciellogroup.com/blog/2019/02/wcag-2-0-parsing-error-bookmarklet/ "Follow link")
3. Run the first bookmarklet in the browser tab containing your target page. It will send the page's DOM to the checker and show the results in a new browser tab.
4. Run the second bookmarklet in the browser tab containing the checker results. It will filter the results to show only WCAG parsing errors.
5. Examine the filtered results to verify that there are no errors related to:
   1. Missing start or end tags
   2. Duplicate attributes
   3. Improper nesting of elements

### Related Content

#### WCAG Success Criteria

- [4.1.1 Parsing](http://www.w3.org/TR/UNDERSTANDING-WCAG20/ensure-compat-parses.html)

#### W3C Techniques

- [G134: Validating Web Pages](http://www.w3.org/TR/2015/NOTE-WCAG20-TECHS-20150226/G134)
- [G192: Fully Conforming to Specifications](http://www.w3.org/TR/2015/NOTE-WCAG20-TECHS-20150226/G192)
- [H88: Using HTML According to Spec](http://www.w3.org/TR/2015/NOTE-WCAG20-TECHS-20150226/H88)
- [H74: Ensuring that opening and closing tags are used according to specification](http://www.w3.org/TR/2015/NOTE-WCAG20-TECHS-20150226/H74)
- [H94: Ensuring that elements do not contain duplicate attributes](http://www.w3.org/TR/2015/NOTE-WCAG20-TECHS-20150226/H94)
- [H75: Ensuring that Web pages are well-formed](http://www.w3.org/TR/2015/NOTE-WCAG20-TECHS-20150226/H75)

#### Common Failures

- [F70: Failure of Success Criterion 4.1.1 due to incorrect use of start and end tags or attribute markup](http://www.w3.org/TR/2015/NOTE-WCAG20-TECHS-20150226/F70)
- [F77: Failure of Success Criterion 4.1.1 due to duplicate values of type ID](http://www.w3.org/TR/2015/NOTE-WCAG20-TECHS-20150226/F77)
