HTML Guides
Learn how to identify and fix common HTML validation errors flagged by the W3C Validator — so your pages are standards-compliant and render correctly across every browser. Also check our Accessibility Guides.
The name attribute was historically used on <option> elements in older HTML specifications, but it has been obsolete since HTML5. The WHATWG HTML Living Standard does not list name as a valid attribute for <option>. The valid attributes for <option> are disabled, label, selected, and value, in addition to the global attributes (such as id, class, style, etc.).
It's important to understand that the name attribute on <option> never served the same purpose as name on <input> or <select>. For form submission, the browser sends the name from the parent <select> element paired with the value of the selected <option>. Putting name on individual <option> elements has no effect on form data and can mislead developers into thinking it influences form behavior.
Removing the obsolete name attribute ensures your HTML is standards-compliant, avoids confusion for developers maintaining the code, and prevents potential issues with future browser behavior. If you need to reference a specific <option> in JavaScript or CSS, use the id global attribute instead.
Examples
Incorrect: using the obsolete name attribute
<select id="pet-select" name="pet">
<option value="">--Please choose an option--</option>
<option name="dog-option" value="dog">Dog</option>
<option name="cat-option" value="cat">Cat</option>
<option name="hamster-option" value="hamster">Hamster</option>
</select>
This triggers the validation error because name is not a valid attribute on <option>.
Correct: using id instead of name
If you need to uniquely identify each option (for example, to target them with JavaScript or CSS), use the id attribute:
<select id="pet-select" name="pet">
<option value="">--Please choose an option--</option>
<option id="dog-option" value="dog">Dog</option>
<option id="cat-option" value="cat">Cat</option>
<option id="hamster-option" value="hamster">Hamster</option>
</select>
Correct: simply removing name if no reference is needed
In most cases, you don't need to identify individual options at all. The value attribute is sufficient for form submission, and you can remove name entirely:
<select id="pet-select" name="pet">
<option value="">--Please choose an option--</option>
<option value="dog">Dog</option>
<option value="cat">Cat</option>
<option value="hamster">Hamster</option>
</select>
Note that the name attribute on the <select> element itself is perfectly valid and necessary — it defines the key used when the form data is submitted. The obsolete attribute warning applies only to name on <option> elements.
The HTML specification defines certain elements as having implicit ARIA roles — roles that are automatically communicated to assistive technologies without any additional attributes. The nav element is one of these: its implicit role is navigation. When you explicitly add role="navigation" to a nav element, you're telling the browser something it already knows, which clutters your markup without adding any value.
This redundancy matters for several reasons:
- Code maintainability: Unnecessary attributes make your HTML harder to read and maintain. Future developers may wonder if the explicit role is there for a specific reason, creating confusion.
- Standards compliance: The W3C validator warns about this because the ARIA specification follows a principle often summarized as the first rule of ARIA: don't use ARIA if a native HTML element already provides the semantics you need. Extending this principle, don't re-declare semantics that are already present.
- No accessibility benefit: Assistive technologies like screen readers already recognize
navas a navigation landmark. Adding the explicit role doesn't improve the experience for users of these technologies — it's simply noise.
The role="navigation" attribute is useful when applied to a non-semantic element like a div or span that functions as navigation but can't be changed to a nav element (for example, due to legacy constraints). But when you're already using nav, the attribute is unnecessary.
To fix this, remove the role="navigation" attribute from your nav element. The semantic meaning is fully preserved.
Examples
Incorrect: redundant role on nav
This triggers the W3C validator warning because the navigation role is already implicit:
<nav role="navigation">
<ul>
<li><a href="/">Home</a></li>
<li><a href="/about">About</a></li>
<li><a href="/contact">Contact</a></li>
</ul>
</nav>
Correct: nav without the explicit role
Simply remove the redundant role attribute:
<nav>
<ul>
<li><a href="/">Home</a></li>
<li><a href="/about">About</a></li>
<li><a href="/contact">Contact</a></li>
</ul>
</nav>
Correct: using role="navigation" on a non-semantic element
If you cannot use a nav element, applying the role to a div is a valid approach. This does not trigger the warning:
<div role="navigation">
<ul>
<li><a href="/">Home</a></li>
<li><a href="/about">About</a></li>
<li><a href="/contact">Contact</a></li>
</ul>
</div>
Correct: labeling multiple nav elements
When a page has more than one nav, use aria-label or aria-labelledby to differentiate them for assistive technology users — but still don't add the redundant role:
<nav aria-label="Main">
<ul>
<li><a href="/">Home</a></li>
<li><a href="/about">About</a></li>
</ul>
</nav>
<nav aria-label="Footer">
<ul>
<li><a href="/privacy">Privacy Policy</a></li>
<li><a href="/terms">Terms of Service</a></li>
</ul>
</nav>
The <noframes> element is obsolete, so remove it and move any content worth keeping into the page's <body> as regular markup.
<noframes> held fallback content for browsers that couldn't display a <frameset>. Every browser in use today displays frames, and the rendering rules in the HTML standard hide <noframes> with display: none wherever it appears, so visitors never see what's inside it. The parser also reads its contents as raw text, the same way it reads a <style> element, so the validator doesn't check the markup inside it either.
The validator reports <noframes> wherever it sits: inside a <frameset>, after the closing </frameset>, in the <head> or in a regular <body>. In the <head> and after </frameset> it also adds an error saying the element isn't allowed there, and that error goes away with this one.
What to do depends on the page around it. In a frameset document, <noframes> goes away together with the <frameset> and its <frame> elements, which get obsolete messages of their own. The fallback often already holds a frameless version of the page, such as links to the documents the frames loaded, and that content can become the start of the new <body>. When <noframes> is left over in a page that already has a <body>, usually copied from an old template, delete it. Nothing inside it was ever displayed, so the page looks the same without it.
Don't move the fallback into an <iframe> instead. An iframe has to stay empty, and the validator reports any content placed inside it.
Invalid example
A two-frame page with a fallback for browsers without frame support:
<!DOCTYPE html>
<html lang="en">
<head>
<title>Club newsletter</title>
</head>
<frameset cols="25%,75%">
<frame src="issues.html">
<frame src="latest.html">
<noframes>
<body>
<p>This site uses frames. Read the <a href="latest.html">latest issue</a> or browse the <a href="issues.html">past issues</a>.</p>
</body>
</noframes>
</frameset>
</html>
Valid example
The frameset becomes a <body>, the links from the fallback become the page's navigation, and an <iframe> loads the issue the second frame used to show:
<!DOCTYPE html>
<html lang="en">
<head>
<title>Club newsletter</title>
</head>
<body>
<nav>
<a href="latest.html" target="issue">Latest issue</a>
<a href="issues.html" target="issue">Past issues</a>
</nav>
<iframe src="latest.html" name="issue" title="Newsletter issue"></iframe>
</body>
</html>
An element with a tabindex attribute is interactive and focusable by the user, which conflicts with role="none" (or its synonym role="presentation"), because that role tells assistive technologies to ignore the element's semantics.
When a browser encounters this conflict, it ignores the role="none" declaration and keeps the element's native semantics. The element remains in the tab order and is announced normally by screen readers. The role="none" has no effect, so the code is misleading.
The role="none" role strips an element of its implicit ARIA semantics. A <table role="none">, for example, is no longer announced as a table. But the HTML spec requires browsers to preserve semantics on any element that is focusable. An element with tabindex is focusable by definition, so the two attributes contradict each other.
To fix this, decide what the element should actually do. If the element should be focusable and interactive, remove role="none". If the element should have no semantics and no interaction, remove tabindex.
Example with the issue
<div role="none" tabindex="0">
Click me
</div>
The validator warns that role="none" is ignored here because tabindex="0" makes the element focusable.
Fixed examples
Remove role="none" if the element should remain focusable:
<div tabindex="0">
Click me
</div>
Or remove tabindex if the element should truly have no semantics and no keyboard interaction:
<div role="none">
Click me
</div>
The <o:p> element is a Microsoft Office namespace tag that has no meaning in HTML and is not part of any HTML specification.
When content is copied from Microsoft Word, Outlook, or other Office applications and pasted into an HTML document, the source often includes proprietary XML namespace elements like <o:p>, <o:OfficeDocumentSettings>, and similar tags. These belong to the urn:schemas-microsoft-com:office:office namespace and are only understood by Office applications. Browsers ignore them, but the W3C validator flags them as errors because they are not valid HTML elements.
The <o:p> tag specifically is used by Word to wrap paragraph content. It typically appears inside <p> elements and most often contains nothing or just a non-breaking space ( ). Removing it entirely has no effect on the rendered page.
If the <o:p> element wraps actual text content, replace it with a standard HTML element like <span> or simply keep the text without any wrapper. If it is empty or contains only , delete it.
HTML examples
Invalid: Office namespace element in HTML
<p>This is a paragraph.<o:p></o:p></p>
<p>
<o:p> </o:p>
</p>
Valid: Office elements removed
<p>This is a paragraph.</p>
When cleaning up Office-generated HTML, also look for other common namespace prefixes like <w:, <m:, and <v:, along with mso- prefixed CSS properties in style attributes. These are all Office artifacts and should be removed. Many text editors and CMS platforms have a "Paste as plain text" option that strips this markup automatically.
The accept-charset attribute on a <form> element only accepts "UTF-8" as its value. Any other character encoding will trigger a validation error.
Older HTML specifications allowed values like "ISO-8859-1", "Windows-1252", or space-separated lists of encodings. The HTML living standard changed this. Now, "UTF-8" is the sole permitted value. Browsers already default to submitting form data in UTF-8 when no accept-charset is specified, so the attribute is rarely needed at all.
If a form currently specifies a non-UTF-8 encoding, the fix is either to switch the value to "UTF-8" or to remove the attribute entirely. Removing it is usually the better choice, since the browser will use UTF-8 by default when the page itself is served as UTF-8 (which it should be).
HTML examples
Invalid usage
<form action="/search" accept-charset="ISO-8859-1">
<input type="text" name="q">
<button type="submit">Search</button>
</form>
Valid usage
Remove the attribute and let the browser default to UTF-8:
<form action="/search">
<input type="text" name="q">
<button type="submit">Search</button>
</form>
Or explicitly set it to "UTF-8":
<form action="/search" accept-charset="UTF-8">
<input type="text" name="q">
<button type="submit">Search</button>
</form>
The meta element's charset attribute only accepts utf-8 as its value in HTML5.
Older HTML versions and XHTML allowed character encodings like windows-1252, iso-8859-1, or shift_jis in the charset attribute. The HTML living standard restricts this to utf-8 only. UTF-8 is the required character encoding for HTML5 documents, and the W3C validator enforces this rule.
If a document actually uses a different encoding, convert the file to UTF-8 using a text editor or command line tool, then update the meta tag accordingly. Most modern text editors can save files as UTF-8.
The <meta charset="utf-8"> declaration should appear as early as possible within the <head> element, ideally as the first child. It must appear within the first 1024 bytes of the document so that browsers can detect the encoding before parsing the rest of the content.
HTML examples
Invalid charset value
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="windows-1252">
<title>Example</title>
</head>
<body>
<p>Hello world</p>
</body>
</html>
Valid charset value
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Example</title>
</head>
<body>
<p>Hello world</p>
</body>
</html>
The <param> element is obsolete in HTML5 and should no longer be used inside <object> elements.
The <param> element was originally used to pass named parameters to plugins embedded via <object>, such as Flash, Java applets, or Windows Media Player. Since modern browsers have dropped support for these plugins, the <param> element lost its purpose and was removed from the HTML living standard.
If the <object> element references an external resource like a video, PDF, or image, the resource URL belongs in the data attribute of the <object> element itself. The type attribute should specify the MIME type of the resource.
For media playback, the <video> and <audio> elements are the standard replacements. For other embedded content, <iframe> or <embed> may be more appropriate depending on the use case.
HTML examples
Before: obsolete param element
<object>
<param name="movie" value="video.mp4">
<param name="autoplay" value="true">
</object>
After: using the data attribute on object
<object data="video.mp4" type="video/mp4">
<p>Your browser does not support this content.</p>
</object>
After: using video for media playback
<video src="video.mp4" controls>
<p>Your browser does not support this video.</p>
</video>
Browsers ignore role="presentation" on an element that has a tabindex attribute, because any tabindex value makes the element focusable and a focusable element keeps its semantics.
role="presentation" (and its synonym role="none") removes an element's implicit role, so assistive technologies read its content without announcing the element itself. WAI-ARIA has a conflict rule for this case: when the element is focusable, browsers must ignore the presentation role and expose the element's implicit role. A user who tabs or clicks onto an element has to be told what it is.
Any tabindex value triggers that rule, including tabindex="-1". A negative value keeps the element out of the Tab sequence, but a script or a mouse click can still focus it. Elements like div, span and img aren't focusable to begin with, so adding tabindex="-1" to them removes nothing from the tab order and only makes them focusable.
Decide what the element is for. If it only wraps content for layout or styling, remove tabindex. If it has to receive focus, remove role="presentation". A decorative image needs neither attribute: alt="" on its own already takes it out of the accessibility tree.
Invalid example
<div class="thumbnail" role="presentation" tabindex="-1">
<img src="harbor.jpg" alt="Harbor at sunset">
</div>
Valid example
Remove tabindex when the wrapper is only there for layout:
<div class="thumbnail" role="presentation">
<img src="harbor.jpg" alt="Harbor at sunset">
</div>
Or remove role="presentation" when the element has to be focusable:
<div class="thumbnail" tabindex="-1">
<img src="harbor.jpg" alt="Harbor at sunset">
</div>
The role="presentation" on this element is ignored because the element also carries a global ARIA attribute, such as aria-label or aria-describedby.
role="presentation" (and its synonym role="none") removes an element's implicit semantics so assistive technologies treat it as if it were plain content. Global ARIA states and properties, such as aria-label, aria-describedby, aria-live, and aria-hidden, are allowed on any element regardless of its role. When one of them is present, the browser cannot silence the element, because that attribute needs a role to attach to. The ARIA specification resolves this conflict by ignoring the presentation role and exposing the element's implicit role instead.
The result is that role="presentation" does nothing here, which is almost always a mistake. Decide which of the two you actually want.
If the element should stay presentational, remove the global ARIA attribute. If you need the ARIA attribute, remove role="presentation" and let the element keep its semantics.
Invalid example
The aria-label cancels the presentation role, so the <div> is not silenced:
<div role="presentation" aria-label="Main navigation">
...
</div>
Valid example
Keep the label and drop the ineffective role:
<div aria-label="Main navigation">
...
</div>
Or, if the element was only meant to be presentational, remove the ARIA attribute:
<div role="presentation">
...
</div>
The profile attribute on <head> comes from HTML 4.01 and is obsolete, so remove it, or move its URL to a <link rel="profile"> element if a tool still reads it.
In HTML 4.01, profile held one or more space-separated URLs of metadata profiles. A profile defined the <meta> names and rel values a page used, so a program reading the page could look up what they meant. Browsers never acted on it, and HTML5 dropped the attribute. The validator reports it as a warning, and the page renders the same with or without it.
The message names a replacement for each of the attribute's two old uses. A page no longer has to declare its <meta> names. The HTML standard defines names like description and generator, and anyone can register other names on the WHATWG MetaExtensions wiki page. If a program read the profile URL to decide how to handle the page, put that URL in a <link rel="profile"> element, which the validator accepts.
The attribute often comes from an older WordPress theme whose header.php prints <head profile="..."> with the URL of the XFN (XHTML Friends Network) profile. Newer WordPress default themes print the same URL in a <link rel="profile"> element instead. Edit the template so the <head> tag has no attributes. If nothing reads the profile, you can leave out the <link> too.
Invalid example
<!DOCTYPE html>
<html lang="en">
<head profile="https://example.com/profiles/xfn">
<title>My blog</title>
</head>
<body>
<p>Welcome to my blog.</p>
</body>
</html>
Valid example
<!DOCTYPE html>
<html lang="en">
<head>
<title>My blog</title>
<link rel="profile" href="https://example.com/profiles/xfn">
</head>
<body>
<p>Welcome to my blog.</p>
</body>
</html>
The role="radio" attribute is redundant on an <input type="radio"> element because the browser already exposes this element with the radio role to assistive technologies.
Screen readers and other assistive tools determine an element's purpose through its implicit ARIA role. The <input type="radio"> element has an implicit role of radio as defined in the ARIA in HTML specification. Adding role="radio" explicitly just repeats what the browser already communicates, and the W3C validator flags this as unnecessary.
Redundant roles add clutter to your markup without any accessibility benefit. In some edge cases, explicitly setting a role that matches the implicit one can even cause unexpected behavior in certain browser and screen reader combinations. The general rule: don't set a role on an element that already has that same role by default.
This applies to many other elements too. For example, <button role="button">, <a href="..." role="link">, and <nav role="navigation"> are all similarly redundant.
HTML examples
Before: redundant role
<label>
<input type="radio" name="color" value="red" role="radio">
Red
</label>
<label>
<input type="radio" name="color" value="blue" role="radio">
Blue
</label>
After: role removed
<label>
<input type="radio" name="color" value="red">
Red
</label>
<label>
<input type="radio" name="color" value="blue">
Blue
</label>
Remove the role="radio" attribute. The element already communicates its role to assistive technologies without it.
The HTML specification and WAI-ARIA guidelines establish that certain HTML elements carry implicit landmark roles. The <section> element implicitly maps to role="region", meaning assistive technologies like screen readers already recognize it as a region landmark without any additional ARIA markup. This principle is captured by the first rule of ARIA use: "If you can use a native HTML element or attribute with the semantics and behavior you require already built in, instead of re-purposing an element and adding an ARIA role, state or property to make it accessible, then do so."
Adding role="region" to a <section> doesn't change the element's behavior or how assistive technologies interpret it — it simply duplicates what the browser already communicates. The W3C Validator warns about this redundancy to encourage cleaner, more maintainable markup and to help developers understand native HTML semantics.
This same principle applies to other HTML elements with implicit roles: <nav> has an implicit role="navigation", <main> has role="main", <aside> has role="complementary", <header> has role="banner" (when not nested in a sectioning element), and <footer> has role="contentinfo" (when not nested in a sectioning element). Adding these explicit roles to their corresponding elements will trigger similar validator warnings.
It's worth noting that a <section> element is only exposed as a region landmark by assistive technologies when it has an accessible name. If your <section> doesn't have an accessible name (via aria-label, aria-labelledby, or similar mechanisms), screen readers may not treat it as a navigable landmark — but this still doesn't mean you should add role="region", since the implicit role mapping remains the same regardless.
How to fix it
- Remove the
role="region"attribute from any<section>element. - If you want the section to be a meaningful landmark for screen reader users, give it an accessible name using
aria-labelledby(pointing to a heading) oraria-label. - Never add explicit ARIA roles that duplicate the implicit role of a native HTML element.
Examples
Incorrect: redundant role on section
<section role="region">
<h2>Contact Information</h2>
<p>Email us at info@example.com</p>
</section>
Correct: section without redundant role
<section>
<h2>Contact Information</h2>
<p>Email us at info@example.com</p>
</section>
Correct: section with an accessible name for landmark navigation
Using aria-labelledby to associate the section with its heading ensures assistive technologies expose it as a named landmark region:
<section aria-labelledby="contact-heading">
<h2 id="contact-heading">Contact Information</h2>
<p>Email us at info@example.com</p>
</section>
Correct: section with aria-label when no visible heading exists
<section aria-label="Contact information">
<p>Email us at info@example.com</p>
</section>
Incorrect: redundant roles on other landmark elements
The same principle applies to other native landmark elements. Avoid these patterns:
<nav role="navigation">
<a href="/">Home</a>
</nav>
<main role="main">
<p>Page content</p>
</main>
<aside role="complementary">
<p>Related links</p>
</aside>
Correct: landmark elements without redundant roles
<nav>
<a href="/">Home</a>
</nav>
<main>
<p>Page content</p>
</main>
<aside>
<p>Related links</p>
</aside>
A <td> inside a <table> with no role, or with a role of table, grid or treegrid, gets its ARIA role from the table and must not have a role attribute of its own.
Browsers map table cells automatically. In a plain table, or one with role="table", each <td> is exposed as a cell. In a table with role="grid" or role="treegrid", each <td> is exposed as a gridcell. The ARIA in HTML specification doesn't let authors set any role on these cells, so the validator rejects redundant values like role="cell" and role="gridcell" as well as roles that turn the cell into something else, such as role="button" or role="presentation".
A <td> exposed as a button is no longer a cell, so screen readers can't announce its row and column headers or reach it with table navigation commands.
To make a cell interactive, put a real control such as a <button> or an <a> inside the <td>. For layout tables, which are common in HTML email, set role="presentation" on the <table> instead of on each cell. Once the table has a role other than table, grid or treegrid, its cells lose their table semantics and the rule no longer applies.
Invalid examples
Data table
<table>
<tr>
<th>Name</th>
<th>Actions</th>
</tr>
<tr>
<td role="cell">Alice</td>
<td role="button" tabindex="0">Edit</td>
</tr>
</table>
Layout table
<table>
<tr>
<td role="presentation">Logo</td>
<td role="presentation">Newsletter title</td>
</tr>
</table>
Valid examples
Data table
<table>
<tr>
<th>Name</th>
<th>Actions</th>
</tr>
<tr>
<td>Alice</td>
<td><button type="button">Edit</button></td>
</tr>
</table>
Layout table
<table role="presentation">
<tr>
<td>Logo</td>
<td>Newsletter title</td>
</tr>
</table>
A <th> gets its ARIA role from the table it belongs to, so it can't have a role attribute when that <table> has no role, or has role="table", role="grid" or role="treegrid".
In those tables the browser works out what each header cell is. A <th> inside <thead>, or in a row of headers above the data, is exposed as columnheader. A <th> at the start of a data row is exposed as rowheader. When the layout is ambiguous, scope="col" or scope="row" states the direction. Screen readers use these roles to announce the right header as the user moves from one data cell to the next.
The ARIA in HTML specification allows no role value at all on a <th> in these tables, so the validator reports this error whatever the value is. With role="columnheader" or role="rowheader" you also get a warning that the role is unnecessary for the element, and deleting the attribute clears both messages. Any other value replaces the header role. A sortable header marked role="button", or a header marked role="presentation", stops being a header, and screen readers no longer read its text before the cells it labels.
To make a column sortable, keep the <th> as it is, put a <button> inside it, and set aria-sort on the <th> for the column that is currently sorted. If the table exists only for layout, put role="presentation" on the <table> instead. A table with a role other than table, grid or treegrid loses its table semantics, and this rule no longer applies to its cells.
Table plugins and page builders often add a role to every part of a table: role="table" on the <table>, role="rowgroup" on <thead> and <tbody>, role="row" on each <tr> and role="cell" on each <td>. The validator reports all of them, with errors for the roles on <tr> and <td> and warnings for the rest, so remove them in the same change.
Invalid example
<table>
<thead>
<tr>
<th scope="col" role="columnheader">Product</th>
<th scope="col" role="button" tabindex="0">Price</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row" role="rowheader">Desk lamp</th>
<td>$45</td>
</tr>
<tr>
<th scope="row" role="rowheader">Notebook</th>
<td>$8</td>
</tr>
</tbody>
</table>
Valid example
<table>
<thead>
<tr>
<th scope="col">Product</th>
<th scope="col" aria-sort="descending">
<button type="button">Price</button>
</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">Desk lamp</th>
<td>$45</td>
</tr>
<tr>
<th scope="row">Notebook</th>
<td>$8</td>
</tr>
</tbody>
</table>
A <tr> element already has an implicit ARIA role of row, so adding role="row" is redundant when the parent <table> uses its default semantics or has a role of table, grid, or treegrid.
HTML tables come with built-in accessibility semantics. The <table> element implicitly has role="table", and <tr> implicitly has role="row". Browsers and assistive technologies already understand this structure, so explicitly adding these roles is unnecessary and flagged by the W3C validator.
The only time you'd need to add a role to a <tr> is when the table's native semantics have been overridden — for example, if the <table> has been repurposed with a non-table role like role="presentation" or role="none". In that case, you'd need explicit ARIA roles to restore row semantics.
Incorrect Example
<table>
<tr role="row">
<th>Name</th>
<th>Email</th>
</tr>
<tr role="row">
<td>Alice</td>
<td>alice@example.com</td>
</tr>
</table>
Fixed Example
Simply remove the redundant role="row" from the <tr> elements:
<table>
<tr>
<th>Name</th>
<th>Email</th>
</tr>
<tr>
<td>Alice</td>
<td>alice@example.com</td>
</tr>
</table>
The same fix applies if your <table> explicitly has role="table", role="grid", or role="treegrid" — the <tr> elements still don't need an explicit role="row" because the browser infers it automatically.
The role attribute is not allowed on a label element when that label is associated with a form control (a labelable element) through the for attribute or by nesting.
When a label is associated with a form control, the browser already understands its purpose — it's a label. Adding a role attribute overrides this native semantics, which is redundant at best and confusing for assistive technologies at worst.
A label becomes "associated" with a labelable element in two ways: explicitly via the for attribute pointing to the control's id, or implicitly by wrapping the control inside the label. Labelable elements include input (except type="hidden"), select, textarea, button, meter, output, and progress.
If the label is associated, simply remove the role attribute. The native semantics are already correct and sufficient.
If you truly need a custom role for some reason and the label is not functionally labeling a control, you can disassociate it by removing the for attribute or unnesting the control — but this is rarely the right approach.
Invalid Example
<label for="email" role="presentation">Email</label>
<input type="email" id="email">
Valid Example
<label for="email">Email</label>
<input type="email" id="email">
A summary element that is the first summary child of a details element can't have a role attribute, whatever its value.
That summary is the control that opens and closes its details element. Browsers expose it as a button and report whether the details is open, and the ARIA in HTML specification allows no role on it. With role="button", the role only repeats what the browser already provides, and the validator also warns that it is unnecessary. Any other value, such as heading or link, tells screen readers the element is something other than the control that shows and hides the content.
This often comes from accordion markup that was moved onto details and summary. A script-driven accordion built from div or span elements needs role="button" and aria-expanded on each toggle. With details, the browser handles keyboard input and tracks the open state, so you can delete both attributes. The validator reports aria-expanded in its own message.
If role="heading" was there to mark the summary as a section title, put a heading element inside the summary instead. Its content model allows headings, but some screen readers announce only the button and drop the heading level, so test it with the ones your users rely on. If the control needs to act as a link or a tab, build a link or a tab widget instead of using details.
Invalid example
The summary toggles its details, so role="button" is not allowed on it.
<details open>
<summary role="button">Billing address</summary>
<p>Enter the address that appears on your card statement.</p>
</details>
Valid example
Without the role attribute, the browser exposes the summary as a button that opens and closes the section.
<details open>
<summary>Billing address</summary>
<p>Enter the address that appears on your card statement.</p>
</details>
A <tr> element already has the ARIA role row, so adding role="row" to it repeats what browsers and screen readers already know.
HTML gives each element a default ARIA role. A <tr> inside a <table> is exposed to assistive technology as a row with no extra markup, and the cells inside it get their roles the same way. Writing role="row" by hand changes nothing for users and makes the markup harder to read.
The same attribute also triggers an error. When the <table> has no role attribute, or has role="table", role="grid" or role="treegrid", its <tr> elements can't have a role attribute at all. Removing role="row" fixes both messages.
This often shows up in tables pasted from online word processors, which add role="row" to every row. The row role is meant for tables built from generic elements such as <div>, where nothing else tells a screen reader which elements form a row. A native <tr> doesn't need it.
Invalid example
<table>
<tr role="row">
<th>Product</th>
<th>Price</th>
</tr>
<tr role="row">
<td>Notebook</td>
<td>$4.50</td>
</tr>
</table>
Valid example
<table>
<tr>
<th>Product</th>
<th>Price</th>
</tr>
<tr>
<td>Notebook</td>
<td>$4.50</td>
</tr>
</table>
A <tbody> element already has the ARIA role rowgroup, so adding role="rowgroup" to it repeats what browsers and screen readers already know.
HTML gives each element a default ARIA role. Inside a <table>, a <tbody> is exposed to assistive technology as a group of rows with no extra markup, and <thead> and <tfoot> get the same rowgroup role. Writing role="rowgroup" by hand changes nothing for users and makes the markup harder to read.
This usually comes from tables pasted from online word processors or built by table plugins, which put an ARIA role on every part of the table. The rowgroup role is meant for tables built from generic elements such as <div>, where nothing else tells a screen reader how the rows are grouped. A native <tbody> doesn't need it, so remove the attribute. If the same table also has role="row" on its <tr> elements or roles on its cells, remove those as well.
Invalid example
<table>
<thead>
<tr>
<th>Plan</th>
<th>Price</th>
</tr>
</thead>
<tbody role="rowgroup">
<tr>
<td>Basic</td>
<td>$10</td>
</tr>
<tr>
<td>Pro</td>
<td>$25</td>
</tr>
</tbody>
</table>
Valid example
<table>
<thead>
<tr>
<th>Plan</th>
<th>Price</th>
</tr>
</thead>
<tbody>
<tr>
<td>Basic</td>
<td>$10</td>
</tr>
<tr>
<td>Pro</td>
<td>$25</td>
</tr>
</tbody>
</table>
The <thead> element is exposed with the ARIA role rowgroup by default, so role="rowgroup" on it only states its built-in role a second time.
Every HTML element maps to a default ARIA role, and the table sections share one: <thead>, <tbody> and <tfoot> are all row groups. Browsers already tell screen readers that the rows inside a <thead> form a group at the top of the table. An explicit role="rowgroup" changes nothing users can notice, which is why the validator reports it as a warning rather than an error.
You'll often see this in tables generated by page builders, table plugins or content copied from online editors, which tend to stamp a role onto every table part. The rowgroup role exists for tables made from generic elements such as <div>, where the markup gives assistive technology no clue about how the rows are grouped. A real <thead> already carries that meaning, so delete the attribute. While you're there, check the rest of the table. In a native <table>, a role on <tr>, <th> or <td> is reported as an error, so remove those in the same pass.
Invalid example
<table>
<thead role="rowgroup">
<tr>
<th>Feature</th>
<th>Included</th>
</tr>
</thead>
<tbody>
<tr>
<td>Backups</td>
<td>Yes</td>
</tr>
<tr>
<td>Priority support</td>
<td>No</td>
</tr>
</tbody>
</table>
Valid example
<table>
<thead>
<tr>
<th>Feature</th>
<th>Included</th>
</tr>
</thead>
<tbody>
<tr>
<td>Backups</td>
<td>Yes</td>
</tr>
<tr>
<td>Priority support</td>
<td>No</td>
</tr>
</tbody>
</table>
A <th> at the start of a data row already has the implicit role rowheader, so adding role="rowheader" to it changes nothing for screen readers.
The browser gives each <th> its ARIA role based on where the cell sits in the table. Header cells in the <thead>, or in a top row of headers, become columnheader. A header cell followed by <td> cells in the same row becomes rowheader. Add scope="row" when you want to state the direction outright: it marks the cell as the header for the rest of its row. The role attribute repeats information the table structure already carries and only makes the markup longer.
You'll get this warning for role="rowheader" on every <th>, whatever its position. If the cell actually heads a column, for example a <th> inside <thead>, the role is also incorrect: it replaces columnheader, so screen readers announce the cell as the label of a row.
Expect an error alongside the warning in most tables. A <th> can't carry any role attribute when its <table> has no role of its own, or has role="table", role="grid" or role="treegrid". Deleting role="rowheader" clears the warning and the error together.
Table plugins and page builders tend to put a role on every row and cell. The rowheader role is for tables built from generic elements such as <div> or <span>, which have no native way to mark a cell as a row header. On a <th>, remove the attribute and keep scope="row". If the same table also sets roles on its <tr>, <td> or <tbody> elements, the validator flags those too, so remove them in the same change.
Invalid example
<table>
<thead>
<tr>
<th scope="col">Plan</th>
<th scope="col">Monthly price</th>
<th scope="col">Storage</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row" role="rowheader">Basic</th>
<td>$5</td>
<td>10 GB</td>
</tr>
<tr>
<th scope="row" role="rowheader">Team</th>
<td>$20</td>
<td>100 GB</td>
</tr>
</tbody>
</table>
Valid example
<table>
<thead>
<tr>
<th scope="col">Plan</th>
<th scope="col">Monthly price</th>
<th scope="col">Storage</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">Basic</th>
<td>$5</td>
<td>10 GB</td>
</tr>
<tr>
<th scope="row">Team</th>
<td>$20</td>
<td>100 GB</td>
</tr>
</tbody>
</table>
In older HTML specifications (HTML 4.01), the scheme attribute was used to provide additional context for interpreting the content value of a <meta> element. It told browsers or metadata processors which encoding scheme, format, or vocabulary applied to the metadata. For example, you could specify that a date followed the W3CDTF format or that a subject classification used a particular taxonomy.
HTML5 dropped the scheme attribute because it was rarely used by browsers and its purpose was better served by making the scheme part of the metadata value itself. The WHATWG HTML living standard does not recognize scheme as a valid attribute on <meta>, so including it will produce a validation error. Keeping obsolete attributes in your markup can cause confusion for developers maintaining the code and signals outdated practices that may accompany other compatibility issues.
This issue most commonly appears in documents that use Dublin Core Metadata Initiative (DCMI) metadata, which historically relied on scheme to indicate the encoding format for dates, identifiers, and subject classifications.
How to fix it
There are several approaches depending on your use case:
- Simply remove the
schemeattribute if the format is already clear from context (e.g., ISO 8601 dates are universally understood). - Incorporate the scheme into the
nameattribute by using a more specific property name that implies the scheme. - Include the scheme declaration in the
contentvalue so the format information is preserved within the value itself.
For Dublin Core metadata specifically, the modern recommended approach is to use the DCTERMS namespace with RDFa or to simply drop the scheme attribute, since most date formats like YYYY-MM-DD are unambiguous.
Examples
Obsolete: using the scheme attribute
This triggers the validation error because scheme is not a valid attribute in HTML5:
<meta name="DC.Date.Created" scheme="W3CDTF" content="2009-11-30">
Another common example with subject classification:
<meta name="DC.Subject" scheme="LCSH" content="Web development">
Fixed: removing the scheme attribute
If the value format is self-evident (as with ISO 8601 dates), simply remove scheme:
<meta name="DC.Date.Created" content="2009-11-30">
Fixed: incorporating the scheme into the value
When the scheme information is important for processors to understand the value, embed it in the content attribute:
<meta name="DC.Subject" content="LCSH: Web development">
Fixed: using a more specific property name
You can make the scheme implicit by using a more descriptive name value:
<meta name="DCTERMS.created" content="2009-11-30">
Fixed: using RDFa for richer metadata
For documents that require precise, machine-readable metadata with explicit schemes, consider using RDFa attributes instead of the obsolete scheme:
<meta property="dcterms:created" content="2009-11-30">
This approach is compatible with HTML5 and provides the same semantic richness that the scheme attribute was originally designed to offer.
The scope attribute tells browsers and assistive technologies how a header cell relates to the data cells around it. Its valid values are col, row, colgroup, and rowgroup. In older versions of HTML, scope was permitted on <td> elements, but the current HTML Living Standard restricts it to <th> elements only. When the W3C validator encounters scope on a <td>, it flags it as obsolete.
This matters for several reasons. First, if a cell acts as a header for other cells, it should be marked up as a <th>, not a <td>. Using <td scope="row"> sends conflicting signals — the element says "I'm a data cell" while the attribute says "I'm a header for this row." Second, screen readers rely on proper <th> elements with scope to announce table relationships. A <td> with scope may not be interpreted correctly, making the table harder to navigate for users of assistive technology. Third, using obsolete attributes means your markup doesn't conform to current standards, which could lead to unpredictable behavior in future browsers.
The fix is straightforward: if a cell has a scope attribute, it's acting as a header and should be a <th> element. Change the <td> to <th> and keep the scope attribute. If the cell is genuinely a data cell and not a header, remove the scope attribute entirely and leave it as a <td>.
Examples
Incorrect: scope on a <td> element
<table>
<tr>
<td scope="col">Name</td>
<td scope="col">Role</td>
</tr>
<tr>
<td scope="row">Alice</td>
<td>Engineer</td>
</tr>
</table>
This triggers the validation error because scope is used on <td> elements. The first row contains column headers and the first column contains row headers, yet they are all marked as data cells.
Correct: scope on <th> elements
<table>
<tr>
<th scope="col">Name</th>
<th scope="col">Role</th>
</tr>
<tr>
<th scope="row">Alice</th>
<td>Engineer</td>
</tr>
</table>
Now the header cells are correctly marked with <th>, and the scope attribute is valid on each one. Screen readers can properly associate "Alice" with "Engineer" and announce the column header "Role" when navigating to that cell.
A more complete table example
<table>
<thead>
<tr>
<th scope="col">Day</th>
<th scope="col">Morning</th>
<th scope="col">Afternoon</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">Monday</th>
<td>Meeting</td>
<td>Code review</td>
</tr>
<tr>
<th scope="row">Tuesday</th>
<td>Workshop</td>
<td>Planning</td>
</tr>
</tbody>
</table>
Here, scope="col" on the column headers in <thead> tells assistive technology that "Day," "Morning," and "Afternoon" each apply to the cells below them. scope="row" on "Monday" and "Tuesday" indicates they apply to the cells in their respective rows. Every scope attribute sits on a <th>, so the markup is valid and accessible.
When to remove scope instead
If the cell truly contains data and isn't a header, simply remove the scope attribute:
<!-- Before (invalid) -->
<td scope="row">Some data</td>
<!-- After (valid) -->
<td>Some data</td>
Only add scope when a cell genuinely serves as a header. If it does, make it a <th>. If it doesn't, leave it as a plain <td> without scope.
Every HTML element carries an implicit ARIA role based on its type and attributes. For <input type="search"> elements that do not have a list attribute, the browser automatically exposes the element with the searchbox role to assistive technologies. This mapping is defined in the ARIA in HTML specification, which establishes the correspondence between native HTML semantics and ARIA roles.
When you explicitly add role="searchbox" to an element that already carries that role implicitly, the validator raises a warning because the attribute is doing nothing useful. While it won't break functionality, redundant roles clutter your markup and can signal to other developers (or future you) that something special is intended when it isn't. Following the general principle of ARIA — "don't use ARIA if you can use native HTML" — also means not restating what the browser already communicates.
Note the distinction the validator makes: this applies specifically to <input type="search"> elements without a list attribute. When a list attribute is present (linking the input to a <datalist>), the implicit role changes to combobox, so in that specific scenario the implicit role is different. However, for a plain search input without list, the searchbox role is already baked in.
Why it matters
- Standards compliance: The W3C validator flags redundant roles to encourage clean, semantic markup that relies on native HTML behavior.
- Maintainability: Redundant attributes add noise. Other developers may wonder why the role was explicitly set and whether removing it would break something.
- ARIA best practices: The first rule of ARIA is to use native HTML semantics whenever possible. Restating implicit roles goes against this principle and can mask situations where an explicit role would actually be meaningful.
How to fix it
Simply remove the role="searchbox" attribute from any <input type="search"> element that does not have a list attribute. The browser and assistive technologies will continue to treat it as a search box.
Examples
Incorrect — redundant role
The role="searchbox" is unnecessary here because <input type="search"> already implies it:
<label for="site-search">Search the site:</label>
<input type="search" id="site-search" role="searchbox" placeholder="Search...">
Correct — relying on implicit role
Remove the redundant role attribute and let native HTML semantics do the work:
<label for="site-search">Search the site:</label>
<input type="search" id="site-search" placeholder="Search...">
Correct — explicit role when implicit role differs
When a list attribute is present, the implicit role changes to combobox. If you want assistive technologies to treat it as a searchbox instead, an explicit role is justified:
<label for="city-search">Search cities:</label>
<input type="search" id="city-search" list="cities" role="searchbox">
<datalist id="cities">
<option value="Amsterdam">
<option value="Berlin">
<option value="Cairo">
</datalist>
In this case, the validator will not flag the role as redundant because the implicit role (combobox) differs from the explicitly set role (searchbox).
Validate at scale.
Ship accessible websites, faster.
Automated HTML & accessibility validation for large sites. Check thousands of pages against WCAG guidelines and W3C standards in minutes, not days.
1K Weekly
1,000 monthly checks. Cancel anytime.
Get 1K Weekly →Join teams across 40+ countries