I just realized that the css selector input[type="submit"] isn't working in IE (only in Mozilla)
Is using input.submit (and then <input class="submit" type="submit" ...>) the only way to solve this problem?
Printable View
I just realized that the css selector input[type="submit"] isn't working in IE (only in Mozilla)
Is using input.submit (and then <input class="submit" type="submit" ...>) the only way to solve this problem?
I do believe so...
IE has extremely crappy support for CSS selectors, IMHO. The only way you're going to get it to work is to use classes. :-(
Hopefully by v7 they'll have remedied that problem!
~~Ian
um no, actually, IE has a great compatibility rate with CSS. Netscape and Opera couldn't top IE when CSS first came out. For one, Opera didnt support the ID selector AND Netscape didn't support things like border-left, etc. NS also didn't support background-fixed, background-repeat, and much others. While NS had buggy problems with these things, IE4 had already perfected most of them. IE has greate support, NS and Opera just need to catch up.
They have... ;-)
~~Ian
ok well. im wrong :( damn! DIE ME YOU BANNED FROM POSTING CAUSE YOU CANT EVEN GET INFO RIGHT! :D
Back to the question at hand, rather than putting a class in each input, you can apply them dynamically.
var x=document.getElementsByTagName('input')
for (i=0; i<x.length;i++) {
if (x[i].getAttribute('type')=='checkbox') {
x[i].className='myCheck';
}
if (x[i].getAttribute('type')=='radio') {
x[i].className='myRadio';
}
if (x[i].getAttribute('type')=='text') {
x[i].className='myText';
}
if (x[i].getAttribute('type')=='submit') {
x[i].className='mySubmit';
}
if (x[i].getAttribute('type')=='button') {
x[i].className='myButton';
}
}
Wow, that's shorter than inserting class="submit" into the only submit button in the form :p
No, seriously, that javascript can be very useful for input[type="text"] etc. :)