CSS :enabled Selector


Example

Set a background color for all enabled <input> elements of type="text":

input[type="text"]:enabled {
  background: #ffff00;
}
Try it Yourself »

More "Try it Yourself" examples below.


Definition and Usage

The :enabled selector matches every enabled element (mostly used on form elements).

Version: CSS3

Browser Support

The numbers in the table specifies the first browser version that fully supports the selector.

Selector
:enabled 4.0 9.0 3.5 3.2 9.6

CSS Syntax

:enabled {
  css declarations;
} Demo

More Examples

Example

Set a background color for all enabled <input> elements:

input:enabled {
  background: #ffff00;
}
Try it Yourself »

Related Pages

CSS Selector Reference: CSS :checked selector

CSS Selector Reference: CSS :disabled selector


Copyright 1999-2023 by Refsnes Data. All Rights Reserved.