Skip to main content

HTML Guide

Free site validation

Find out what web pages on your sites are affected by HTML issues.

The “button” role is unnecessary for element “summary”.

The <summary> HTML element specifies a clickable summary, caption, or legend for a <details> element’s disclosure box. As the <summary> element has an implicit button role, it’s not needed to include it explicitly.

Here’s an example, clicking the <summary> element toggles the state of the parent <details> element open and closed.

    <summary>I have keys but no doors. I have space but no room. You can enter but can’t leave. What am I?</summary>
    A keyboard.

Learn more:

Related W3C validator issues