# The “aria-label” attribute must not be specified on any “div” element unless the element has a “role” value other than “caption”, “code”, “deletion”, “emphasis”, “generic”, “insertion”, “paragraph”, “presentation”, “strong”, “subscript”, or “superscript”.

> Canonical HTML version: https://rocketvalidator.com/html-validation/the-aria-label-attribute-must-not-be-specified-on-any-div-element-unless-the-element-has-a-role-value-other-than-caption-code-deletion-emphasis-generic-insertion-paragraph-presentation-strong-subscript-or-superscript
> Attribution: Rocket Validator (https://rocketvalidator.com)
> License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/)

A `div` element without an explicit role resolves to the `generic` role, which does not support naming — so adding `aria-label` to a plain `div` is invalid.

The `aria-label` attribute provides an accessible name for an element, but not every element is allowed to have one. The ARIA specification defines certain roles as "naming prohibited," meaning assistive technologies will ignore any accessible name applied to them. The `generic` role is one of these, and since a `div` without an explicit `role` attribute defaults to `generic`, the `aria-label` is effectively meaningless.

To fix this, you have two main options: assign an appropriate ARIA role to the `div` so it becomes a nameable landmark or widget, or switch to a semantic HTML element that already carries a valid role. Common roles that support naming include `region`, `group`, `navigation`, `alert`, and many others.

If the `div` is truly just a generic wrapper with no semantic meaning, consider whether `aria-label` is even needed. Perhaps the label belongs on a child element instead, or the content is already self-describing.

## HTML Examples

### ❌ Invalid: `aria-label` on a plain `div`

```html
<div aria-label="User profile section">
  <p>Welcome, Jane!</p>
</div>
```

### ✅ Fix: Add an appropriate `role`

```html
<div role="region" aria-label="User profile section">
  <p>Welcome, Jane!</p>
</div>
```

### ✅ Fix: Use a semantic element instead

```html
<section aria-label="User profile section">
  <p>Welcome, Jane!</p>
</section>
```
