CSS enabled Selector (:enabled)

What is CSS :enabled Selector?

CSS :enabled selector select all <input> element whose are enabled state.

Syntax

General syntax of CSS :enabled selector,

:disabled {
  property: value;
  property: value;
  ...
}

input:disabled {
  property: value;
  property: value;
  ...
}

Example

CSS :focus selector occur when user perform mouse click action perform inside element.

<!DOCTYPE html>
<html>
<head>
  <title>CSS :enabled Selector</title>
  <style type="text/css">
    input:enabled {
      background-color: yellow;
    }
  </style>
</head>
<body>
  <input type="text" name="username" placeholder="Username" />
</body>
</html>

Run it...   »

Browser Compatibility

  • Google Chrome 2+
  • Mozilla Firefox 1.5+
  • Internet Explorer 9+
  • Opera 9.2+
  • Safari 3.1+

Note: Here details of browser compatibility with version number may be this is bug and not supported. But recommended to always use latest Web browser.