# :enabled

> The `:enabled` CSS pseudo-class applies to form elements that are currently enabled and can be interacted with.

## What does the CSS :enabled selector match?

The pseudo-class that targets form elements that are active and can be interacted with by the user. It's the opposite of `:disabled` pseudo-class and is often used to style inputs, buttons or other controls that are ready for user input.

- Topic: Pseudo Classes
- Type: pseudo-class
- Browser support: Chrome 1+, Chrome Android 18+, Edge 12+, Firefox 1+, Firefox Android 4+, Safari 3.1+, Safari iOS 2+

## Example

Wrong:

```css
button:hover {
  background: #0047b3;
}
```

Right:

```css
button:enabled:hover {
  background: #0047b3;
}
```

Adding `:enabled` stops disabled buttons from reacting to hover, so they don't look clickable.

## Common mistakes

- Expecting `:enabled` to match custom controls built from `div` elements.
- Forgetting that buttons with `aria-disabled='true'` still match `:enabled`.

## Key points

- `:enabled` styles target form controls like `button:enabled` or `input:enabled`, not plain `div`s.
- Hover effects on buttons use `button:enabled:hover` so disabled buttons don't react.

## Interview questions

### Is :enabled the opposite of :disabled?

Yes, for elements that can be disabled. Elements that can't be disabled, like `div`, match neither.

### Is :enabled the same as :not(:disabled)?

No. `:not(:disabled)` also matches elements like `div`, while `:enabled` matches only elements that can be disabled.

## Related cards

- [:disabled](https://wonderium.dev/css/disabled.md)
- [:hover](https://wonderium.dev/css/hover.md)
- [`<button>`](https://wonderium.dev/html/button.md)
- [\[aria-disabled\]](https://wonderium.dev/a11y/aria-disabled.md)

---

- Level: [CSS](https://wonderium.dev/css.md)
- HTML version: https://wonderium.dev/css/enabled
- Last updated: 2026-11-25
