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

> Canonical HTML version: https://rocketvalidator.com/html-validation/bad-value-alert-for-attribute-role-on-element-aside
> Attribution: Rocket Validator (https://rocketvalidator.com)
> License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/)

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

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

## Valid example

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