Skip to main content
HTML Validation

Bad value “alert” for attribute “role” on element “aside”.

About This HTML Issue

An <aside> element can't take role="alert", because ARIA in HTML only lets you override its implicit complementary role with a short list of roles, and alert isn't one of them.

Screen readers expose <aside> as a complementary landmark: content related to the page but separate from it, like a sidebar or a callout box. The alert role means something else. It marks a live region whose content is announced as soon as it changes, which suits error messages, session timeouts and other urgent notices. One element can't be both a landmark and a live message, so the validator rejects the value. Among the roles the validator accepts on <aside> are note and region.

The markup usually comes from a notice banner or cookie box built on <aside> with the role added so screen readers announce it. Put role="alert" on a <div> instead. If the notice belongs inside a sidebar, keep the <aside> and nest the <div role="alert"> in it. If the box is a static tip that nobody needs to hear the moment it appears, drop the role or use role="note".

Invalid example

<aside role="alert">
  <p>Your session will expire in 2 minutes.</p>
</aside>

Valid example

<div role="alert">
  <p>Your session will expire in 2 minutes.</p>
</div>

Find issues like this automatically

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

Help us improve our guides

Was this guide helpful?
🌍 Trusted by teams worldwide

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.

Scheduled Reports
API Access
Open Source Standards
€5 / week

1K Weekly

1,000 monthly checks. Cancel anytime.

Get 1K Weekly →

Join teams across 40+ countries