HTML Guides for role
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 role="list" attribute is redundant on an <ol> element because it already has an implicit ARIA role of list.
HTML elements come with built-in (implicit) ARIA roles that convey their purpose to assistive technologies. The <ol> and <ul> elements both have an implicit role of list, so explicitly adding role="list" is unnecessary and creates noise in your markup.
That said, there's a well-known reason some developers add this role intentionally. Safari removes list semantics when list-style: none is applied via CSS. Adding role="list" is a common workaround to restore those semantics for VoiceOver users. If this is your situation, the W3C warning is technically correct but you may choose to keep the role for accessibility reasons.
If you don't need the Safari workaround, simply remove the role attribute.
Before
<ol role="list">
<li>First item</li>
<li>Second item</li>
<li>Third item</li>
</ol>
After
<ol>
<li>First item</li>
<li>Second item</li>
<li>Third item</li>
</ol>
The HTML specification assigns implicit ARIA roles to many elements, meaning browsers and assistive technologies already understand their purpose without any extra attributes. The ul element has a built-in role of list, the nav element has a role of navigation, the button element has a role of button, and so on. When you explicitly add a role that matches the element's implicit role, it creates redundancy that the validator warns about.
This principle is formalized as the first rule of ARIA use: do not use ARIA if a native HTML element already provides the semantics you need. Adding redundant ARIA roles clutters your markup, can confuse developers maintaining the code, and in rare edge cases may cause assistive technologies to announce information twice or behave unexpectedly.
This same warning applies to other elements with implicit roles, such as adding role="navigation" to a nav element, role="banner" to a header element, or role="contentinfo" to a footer element.
A note about Safari and list-style: none
There is one well-known exception worth mentioning. Safari intentionally removes list semantics from ul and ol elements when list-style: none is applied via CSS. This means VoiceOver on macOS and iOS will not announce the element as a list. In this specific case, some developers deliberately add role="list" to restore the list semantics. While the W3C validator will still flag it as redundant (since it evaluates HTML in isolation, without considering CSS), this is a legitimate accessibility pattern where the redundant role serves a real purpose. If you're in this situation, you may choose to keep role="list" and accept the validator warning.
Examples
Incorrect: redundant role="list" on ul
<ul role="list">
<li>Apples</li>
<li>Bananas</li>
<li>Cherries</li>
</ul>
Correct: relying on implicit semantics
<ul>
<li>Apples</li>
<li>Bananas</li>
<li>Cherries</li>
</ul>
Incorrect: other common redundant roles
<nav role="navigation">
<a href="/">Home</a>
<a href="/about">About</a>
</nav>
<main role="main">
<h1>Welcome</h1>
</main>
<footer role="contentinfo">
<p>© 2024 Example Inc.</p>
</footer>
Correct: native elements without redundant roles
<nav>
<a href="/">Home</a>
<a href="/about">About</a>
</nav>
<main>
<h1>Welcome</h1>
</main>
<footer>
<p>© 2024 Example Inc.</p>
</footer>
Acceptable exception: restoring semantics removed by CSS
If your stylesheet strips list markers and you need to preserve list semantics for screen readers, the redundant role is a pragmatic choice:
<!-- list-style: none is applied via CSS, which removes semantics in Safari -->
<ul role="list" class="unstyled-list">
<li>Step one</li>
<li>Step two</li>
<li>Step three</li>
</ul>
In this case, you can suppress or ignore the validator warning, understanding that it serves an accessibility need that the validator cannot detect from the HTML alone.
The listbox role is the implicit ARIA role for a <select> element only when it has a multiple attribute or a size attribute greater than 1. A standard single-selection <select> (dropdown) has an implicit role of combobox, so explicitly assigning role="listbox" to it creates a conflict.
When a <select> element has no multiple attribute and no size greater than 1, browsers render it as a collapsed dropdown — a combobox. The listbox role describes a widget where all options are persistently visible, which matches the behavior of a multi-select or a select with a visible size greater than 1. Applying role="listbox" to a standard dropdown misrepresents the control to assistive technologies.
You have a few options to fix this: remove the role="listbox" entirely (since the browser already assigns the correct implicit role), add the multiple attribute, or set size to a value greater than 1.
Incorrect Example
<select role="listbox" name="color">
<option value="red">Red</option>
<option value="blue">Blue</option>
<option value="green">Green</option>
</select>
Fixed Examples
Remove the explicit role and let the browser handle it:
<select name="color">
<option value="red">Red</option>
<option value="blue">Blue</option>
<option value="green">Green</option>
</select>
Or, if you genuinely need role="listbox", use multiple or size greater than 1:
<select role="listbox" name="color" multiple>
<option value="red">Red</option>
<option value="blue">Blue</option>
<option value="green">Green</option>
</select>
<select role="listbox" name="color" size="3">
<option value="red">Red</option>
<option value="blue">Blue</option>
<option value="green">Green</option>
</select>
In most cases, simply removing role="listbox" is the best fix. The implicit ARIA roles already convey the correct semantics to assistive technologies without any extra attributes.
Many HTML elements have built-in (implicit) ARIA roles defined by the WAI-ARIA specification. The <li> element natively carries the listitem role when it is a child of a <ul>, <ol>, or <menu> element. Adding role="listitem" explicitly doesn't change behavior, but it clutters your markup and signals a misunderstanding of how semantic HTML and ARIA interact. This falls under the first rule of ARIA use: "If you can use a native HTML element with the semantics and behavior you require already built in, do so, instead of re-purposing an element and adding an ARIA role."
Redundant ARIA roles create several problems:
- Maintenance burden — Extra attributes add noise to your code, making it harder to read and maintain.
- Potential confusion — Other developers may wonder if the explicit role was added intentionally to override something, leading to uncertainty during code reviews.
- Validator warnings — Tools like the W3C HTML Validator flag these redundancies, and accumulating unnecessary warnings can obscure real issues that need attention.
The ARIA listitem role is designed for situations where you cannot use semantic HTML — for instance, when you need to create a list-like structure from generic elements like <div> or <span>. In those cases, you would pair role="list" on the container with role="listitem" on each child. But when you're already using <ul>, <ol>, or <menu> with <li> children, the ARIA roles are built in and should not be repeated.
To fix this, simply remove the role="listitem" attribute from your <li> elements. If you also have role="list" on a <ul> or <ol>, remove that too — it's equally redundant.
Examples
❌ Redundant role on <li> elements
<ul role="list">
<li role="listitem">Apples</li>
<li role="listitem">Bananas</li>
<li role="listitem">Cherries</li>
</ul>
Both role="list" on the <ul> and role="listitem" on each <li> are unnecessary because these elements already carry those roles implicitly.
✅ Clean semantic HTML without redundant roles
<ul>
<li>Apples</li>
<li>Bananas</li>
<li>Cherries</li>
</ul>
The <ul> and <li> elements provide all the accessibility semantics needed without any explicit ARIA attributes.
✅ Using ARIA roles on non-semantic elements (when necessary)
If for some reason you cannot use native list elements, ARIA roles are appropriate on generic elements:
<div role="list">
<div role="listitem">Apples</div>
<div role="listitem">Bananas</div>
<div role="listitem">Cherries</div>
</div>
This is the intended use case for role="listitem" — adding list semantics to elements that don't have them natively. However, using semantic <ul>/<ol> with <li> is always preferred when possible.
The ARIA specification defines a set of roles that convey the purpose of an element to assistive technologies like screen readers. Many HTML elements have implicit ARIA roles — built-in semantics that map directly to ARIA roles without any extra markup. The <main> element is one of these: it automatically communicates the main landmark role to assistive technologies.
When you write <main role="main">, you're explicitly stating something the browser and assistive technologies already know. The W3C validator warns about this redundancy because it can signal a misunderstanding of how native HTML semantics work. While it won't break anything, unnecessary attributes add noise to your markup and can make code harder to maintain.
This principle applies broadly across HTML. For example, <nav> implicitly has role="navigation", <header> implicitly has role="banner" (when not nested inside a sectioning element), and <button> implicitly has role="button". Explicitly restating these roles is discouraged by both the W3C and the ARIA in HTML specification, which states: "Setting an ARIA role and/or aria-* attribute that matches the implicit ARIA semantics is unnecessary and is NOT RECOMMENDED."
Why this matters
- Code clarity: Redundant attributes make your HTML harder to read and can confuse other developers into thinking the attribute is necessary.
- Standards compliance: The W3C validator raises a warning, which can obscure more important issues in your validation reports.
- Best practices: Following the principle of using native HTML semantics without redundant ARIA keeps your code clean and aligns with the first rule of ARIA: "If you can use a native HTML element with the semantics and behavior you require already built in, do so, instead of re-purposing an element and adding an ARIA role."
How to fix it
Remove the role="main" attribute from any <main> element. The semantic meaning is already provided by the element itself.
If you're working with a <div> or another generic element that needs the main landmark role (for example, in a legacy codebase that cannot use <main>), then role="main" is appropriate and necessary on that element.
Examples
❌ Redundant role on <main>
<main role="main">
<h1>Welcome to my site</h1>
<p>This is the primary content of the page.</p>
</main>
The role="main" attribute is unnecessary here because <main> already implies it.
✅ Using <main> without a redundant role
<main>
<h1>Welcome to my site</h1>
<p>This is the primary content of the page.</p>
</main>
✅ Using role="main" on a non-semantic element (when necessary)
<div role="main">
<h1>Welcome to my site</h1>
<p>This is the primary content of the page.</p>
</div>
This approach is valid when you cannot use the <main> element — for instance, due to framework constraints or legacy browser support requirements. In most modern projects, prefer the <main> element instead.
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 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 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.
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>
The role="table" attribute on a <table> element is redundant because the <table> element already has an implicit ARIA role of table.
Every HTML element carries a default ARIA role defined by the HTML specification. The <table> element's built-in role is table, so adding role="table" explicitly tells assistive technologies something they already know. The W3C validator flags this as unnecessary markup.
This applies to many other elements too. A <nav> element has an implicit role of navigation, a <button> has a role of button, and so on. Adding these explicit roles creates noise in the code without any accessibility benefit.
Incorrect example
<table role="table">
<tr>
<th>Name</th>
<th>Age</th>
</tr>
<tr>
<td>Alice</td>
<td>30</td>
</tr>
</table>
Fixed example
<table>
<tr>
<th>Name</th>
<th>Age</th>
</tr>
<tr>
<td>Alice</td>
<td>30</td>
</tr>
</table>
When you use semantic HTML elements, browsers automatically assign appropriate ARIA roles behind the scenes. An <input type="text"> element without a list attribute is inherently recognized by browsers and assistive technologies as a textbox — a control that accepts free-form text input. Explicitly declaring role="textbox" on such an element repeats information that is already conveyed natively, which is what the validator flags.
The distinction about the list attribute matters because when an <input type="text"> does have a list attribute (linking it to a <datalist>), its implicit role changes to combobox rather than textbox. In that scenario, a role="textbox" would not only be redundant — it would actually be incorrect. The validator's message specifically targets the case where there is no list attribute, meaning the implicit role is already textbox.
Why this is a problem
- Redundancy clutters your code. Adding roles that elements already possess makes HTML harder to read and maintain without providing any benefit.
- Potential for confusion. Other developers (or your future self) may wonder if the explicit role was added intentionally to override some other behavior, leading to unnecessary investigation.
- Standards compliance. The W3C and WAI-ARIA authoring practices recommend against setting ARIA roles that duplicate the native semantics of an element. The first rule of ARIA use is: "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."
- No accessibility benefit. Assistive technologies already understand that
<input type="text">is a textbox. The explicit role adds no additional information for screen readers or other tools.
How to fix it
Simply remove the role="textbox" attribute from your <input type="text"> element. The native semantics of the element are sufficient.
If you've added the role because the input is styled or behaves differently, consider whether you actually need a different element or a different ARIA pattern instead.
Examples
❌ Incorrect: redundant role="textbox"
<label for="username">Username</label>
<input type="text" id="username" role="textbox">
The role="textbox" is unnecessary here because <input type="text"> without a list attribute already has an implicit role of textbox.
✅ Correct: no explicit role needed
<label for="username">Username</label>
<input type="text" id="username">
✅ Also correct: input with list attribute (different implicit role)
<label for="color">Favorite color</label>
<input type="text" id="color" list="colors">
<datalist id="colors">
<option value="Red">
<option value="Green">
<option value="Blue">
</datalist>
In this case, the list attribute changes the implicit role to combobox, so the validator warning about a redundant textbox role would not apply. Note that adding role="textbox" here would be incorrect rather than merely redundant, since it would override the proper combobox semantics.
❌ Incorrect: redundant role on implicit text input
<label for="search-field">Search</label>
<input id="search-field" role="textbox">
When the type attribute is omitted, <input> defaults to type="text", so the implicit role is still textbox and the explicit role remains redundant.
✅ Correct: let the default type handle semantics
<label for="search-field">Search</label>
<input id="search-field">
A <textarea> element already has the ARIA role textbox, so role="textbox" on it repeats what the browser tells assistive technologies anyway.
Browsers expose every <textarea> as a multi-line text box, together with its label, value and placeholder. Adding the role changes nothing, which is why the validator reports it as a warning and not as an error.
The attribute is often left over from a chat or comment box that started as a <div contenteditable>. A <div> has no role of its own and does need role="textbox", but a real <textarea> doesn't. Don't swap the role for another one either: textbox is the only role a <textarea> accepts, and the validator rejects others such as searchbox or combobox with a "Bad value" error. Remove the attribute.
Invalid example
<form action="/chat">
<label for="message">Message</label>
<textarea id="message" name="message" rows="3" role="textbox"></textarea>
<button type="submit">Send</button>
</form>
Valid example
<form action="/chat">
<label for="message">Message</label>
<textarea id="message" name="message" rows="3"></textarea>
<button type="submit">Send</button>
</form>
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