Skip to main content
HTML Validation

The “dialog” role is unnecessary for element “dialog”.

About This HTML Issue

The role="dialog" attribute is redundant when used on a <dialog> element because <dialog> has an implicit dialog role by default.

According to the WHATWG HTML living standard and ARIA in HTML, the <dialog> element already has the appropriate semantics for assistive technologies, so explicitly adding role="dialog" is unnecessary and causes warnings in validators.

Incorrect usage:

<dialog role="dialog">
  This is a dialog box.
</dialog>

Correct usage:

<dialog>
  This is a dialog box.
</dialog>

Simply remove the role attribute from the <dialog> element to resolve the warning.

Last reviewed: August 07, 2025

Was this guide helpful?

Find issues like this automatically

Rocket Validator scans thousands of pages in seconds, detecting HTML issues across your entire site.

Ready to validate your sites?
Start your free trial today.