# The “listbox” role is not allowed for element “select” without a “multiple” attribute and without a “size” attribute whose value is greater than 1.

> Canonical HTML version: https://rocketvalidator.com/html-validation/the-listbox-role-is-not-allowed-for-element-select-without-a-multiple-attribute-and-without-a-size-attribute-whose-value-is-greater-than-1
> Attribution: Rocket Validator (https://rocketvalidator.com)
> License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/)

The `listbox` role is the implicit ARIA role for a `<select>` element only when it has a `multiple` attribute or a `size` attribute greater than 1. A standard single-selection `<select>` (dropdown) has an implicit role of `combobox`, so explicitly assigning `role="listbox"` to it creates a conflict.

When a `<select>` element has no `multiple` attribute and no `size` greater than 1, browsers render it as a collapsed dropdown — a combobox. The `listbox` role describes a widget where all options are persistently visible, which matches the behavior of a multi-select or a select with a visible size greater than 1. Applying `role="listbox"` to a standard dropdown misrepresents the control to assistive technologies.

You have a few options to fix this: remove the `role="listbox"` entirely (since the browser already assigns the correct implicit role), add the `multiple` attribute, or set `size` to a value greater than 1.

## Incorrect Example

```html
<select role="listbox" name="color">
  <option value="red">Red</option>
  <option value="blue">Blue</option>
  <option value="green">Green</option>
</select>
```

## Fixed Examples

Remove the explicit role and let the browser handle it:

```html
<select name="color">
  <option value="red">Red</option>
  <option value="blue">Blue</option>
  <option value="green">Green</option>
</select>
```

Or, if you genuinely need `role="listbox"`, use `multiple` or `size` greater than 1:

```html
<select role="listbox" name="color" multiple>
  <option value="red">Red</option>
  <option value="blue">Blue</option>
  <option value="green">Green</option>
</select>
```

```html
<select role="listbox" name="color" size="3">
  <option value="red">Red</option>
  <option value="blue">Blue</option>
  <option value="green">Green</option>
</select>
```

In most cases, simply removing `role="listbox"` is the best fix. The implicit ARIA roles already convey the correct semantics to assistive technologies without any extra attributes.
