using javascript/jquery to fix internet explorer
Posted: Mon Jul 09, 2007 12:27 pm
Basically what I'm trying to do is apply a .text and a .textFocus to certain elements. for example: input and input:focus, respectively. So what I've done is this:
I am not concerned with the focus portion at this point... only with applying the correct class to the correct elements. For some reason ie just won't comply
and the css
For some reason this does not work. The class .textinput is not being applied to the element in this case. I know that jquery is selecting the correct elements (from testing it). I also tried this, and it works, but I don't want to have to define my textinput classes twice, that would be totally lame. 
Does anybody know why this might be happening? 
I am not concerned with the focus portion at this point... only with applying the correct class to the correct elements. For some reason ie just won't comply
Code: Select all
$(function(){
$('input[@type="text"]').addClass('textinput');
});Code: Select all
form input[type="text"],
form input[type="password"],
form textarea,
form .textinput {
border: 1px solid #666;
padding: 2px;
}Code: Select all
form input[type="text"],
form input[type="password"],
form textarea {
border: 1px solid #666;
padding: 2px;
}
form .textinput {
border: 1px solid #666;
padding: 2px;
}