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?
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.
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';
}
}
Bookmarks