using javascript/jquery to fix internet explorer

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

using javascript/jquery to fix internet explorer

Post by Luke »

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 :(

Code: Select all

$(function(){

    $('input[@type="text"]').addClass('textinput');

});
and the css

Code: Select all

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. :(

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;

}
Does anybody know why this might be happening? :(
Post Reply