CSS enabled pseudo selector
Milap Patel
Technical Manager | Node.js | React | JavaScript | AWS Certified Cloud Practitioner | PHP | WordPress | Front-end | MongoDB | MySQL
The :enabled pseudo-class in CSS selects focusable elements that are not disabled, and therefore enabled. It is only associated with form elements (input, select, textarea). Enabled elements include ones in that you can select, that you can enter data into, or that you can focus on or click.
In theory, :enabled should match an a, area, or link with href attributes, but browsers don’t seem to handle that scenario. You can style button, input, textarea, optgroup, option and fieldsets that are not disabled. When menu is supported, we should also be able to target command and li‘s that are children of menu, if not disabled.
You would also think that elements with contenteditable and tabindex attributes would be selectable with the :enabled pseudo-class.