Rocket Validator automatically checks your pages on the W3C Validator.
button element cannot contain a descendant element with the attribute
Related W3C validator issues
button element, or an element with the
role=button attribute, is not allowed to be nested inside an
<a> element cannot contain a descendant element with the attribute
aria-expanded attribute can only be
This attribute indicates whether a grouping element is expanded or collapsed.
<li> element, used to define a list item, does not accept the
This HTML code is invalid because the
<li> elements can’t have
<ul> <li role="button">One</li> <li role="button">Two</li> </ul>
button role is used to make an element appear as a button control to a screen reader and can be applied to otherwise non-interactive elements like
<div>. If you’re already using a
<button> element, then it’s redundant to apply it the role
button, as that’s implicit.
<!-- Instead of this --> <button role="button">Buy</button> <!-- Do this --> <button>Buy</button>
An element with
role=button can’t have an
input element as descendant.
The ARIA role
button can be added to an element to make it behave like a
<button> – just like a
<button> is not allowed to contain other
<input> elements as descendants, any element with this role is not allowed to contain them either.
All these examples in the following code will raise a similar issue:
<div role="button"> <input type="checkbox" /> </div> <button> <input type="checkbox" /> </button> <a> <input type="checkbox" /> </a>
When was the last time you validated your whole site?
Keep your sites healthy checking for A11Y/HTML issues on an automated schedule.