CSS :enabled Selector
The :enabled selector is used to set the background color in enabled element in a form.
Syntax:
:enabled { //property }
Example:
HTML
<!DOCTYPE html> < html > < head > < style > input[type=text]:enabled { background: limegreen; } input[type=text]:disabled { background: silver; } </ style > </ head > < body > < form action = "" > Name: < input type = "text" value = "Dharamenda" > < br > <!--enabled--> User ID: < input type = "text" disabled = "disabled" value = "@dharam" > < br > < button type = "button" >Submit</ button > </ form > </ body > </ html > |
Output:
Supported Browsers:
- Google Chrome 1.0
- Edge 12.0
- Firefox 1.0
- Safari 3.1
- Opera 9.0
Contact Us