Skip to content
Related Articles

Related Articles

CSS | :enabled Selector

View Discussion
Improve Article
Save Article
Like Article
  • Last Updated : 21 Dec, 2018

The :enabled selector is used to set the background color in enabled element in a form.


:enabled {


<!DOCTYPE html>
        input[type=text]:enabled {
            background: limegreen;
        input[type=text]:disabled {
            background: silver;
    <form action="">
        <input type="text" value="Dharamenda">
        User ID:
        <input type="text" disabled="disabled" value="@dharam">
        <button type="button">Submit</button>


Supported Browsers:

  • Google Chrome 4.0
  • Edge 9.0
  • Firefox 3.5
  • Safari 3.2
  • Opera 9.6
  • My Personal Notes arrow_drop_up
    Recommended Articles
    Page :

    Start Your Coding Journey Now!