How can I get the css focus selector to work for previously disabled fields?
Dec.19, 2006 in
CSS
Pandemic asked:
ok, I have some css defined that will change the background color of a text box once it has focus. The code works fine, except for if I set the focus to a previously disabled (recently enabled by javascript) text box. Any ideas on how I can fix this?
Here is the code:
input[type=text]:focus
{
background-color: #DEE1F7;
}
By the way this code doesn’t work in Internet Explorer. That is another problem I’m trying to tackle.
Custom Search
December 20th, 2006 at 12:40 am
The focus pseudoselector is not supported in IE, you’ll need to use JS to emulate it for IE users.
The attribute selector [type=text] is not supported by IE either. In general, you’ll find that the experienced code slingers have resigned themselves to using classes for way more elements than we should have to because of selector deficiencies in all browsers, especially IE.