:enabled Back
- In comparison with
:disabled,:enabledis a pseudo-class selector used to select and style user interface elements (usually form elements) that are enabled. :enabledallows us to select only the enabled user interface elements, thus filtering out the disabled ones.
Case: enable button with hover
See the Pen xZXYaj by aleen42 (@aleen42) on CodePen.
Note
- The
enabledattribute is an HTML5 attribute that can be set to the elements:<button>,<input>,<textarea>,<optgroup>,<option>, and<fieldset>. - In comparison,
:disabledis to disable elements as a disabled state. - The
displayandvisibilityproperties have no effect on the enabled/disabled state of an element, even if they are set to hide the element.
