CSS :enabled Selector

❮ Previous Selectors Next ❯

The following example make <input> field background red if it enabled.

Example

input:enabled {
  background: red;
}

input:disabled {
  background: blue;
}

Meaning

The :enabled selector selects the elements that are currently enabled.

An element is enabled if it can be activated (selected, clicked on, typed into, etc.) or accept focus.

The element also has a disabled state, in which it can't be activated or accept focus.

Version: CSS3




Standard Syntax

:enabled {
  css declarations;
}



Browser Support

The numbers in the table specify the first browser version that fully supports the property.




Status







❮ Previous Selectors Next ❯