CSS enabled pseudo selector

CSS enabled pseudo selector

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.

要查看或添加评论,请登录

Milap Patel的更多文章

社区洞察

其他会员也浏览了