Luke wrote:
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.
Javascript:
$(function(){

    $('[EMAIL PROTECTED]"text"]').addClass('textinput');

});


and the css

CSS:
form input[type="text"],

form input[type="password"],

form textarea,

form .textinput {

    border: 1px solid #666;

    padding: 2px;

}


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. Sad

CSS:
form input[type="text"],

form input[type="password"],

form textarea {

    border: 1px solid #666;

    padding: 2px;

}

form .textinput {

    border: 1px solid #666;

    padding: 2px;

}


Does anybody know why this might be happening?


IE 6 does not understand the attribute selectors and therefore skips the whole rule. So you cannot group them together and need to define the rules twice like in your second example.


--Klaus

Reply via email to