SitePoint Sponsor |
|
User Tag List
Results 1 to 8 of 8
Thread: css selector for <input>
Hybrid View
-
Sep 11, 2002, 15:56 #1
- Join Date
- Mar 2002
- Location
- Svíþjóð
- Posts
- 4,080
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
css selector for <input>
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?
-
Sep 11, 2002, 16:40 #2
- Join Date
- May 2002
- Location
- Melbourne, Australia
- Posts
- 299
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I do believe so...
-
Sep 11, 2002, 16:47 #3
- Join Date
- Oct 2001
- Location
- Beyond yonder
- Posts
- 2,384
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
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
-
Sep 11, 2002, 17:24 #4
- Join Date
- Jan 2002
- Posts
- 178
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
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.
InQuE
-
Sep 11, 2002, 18:11 #5
- Join Date
- Oct 2001
- Location
- Beyond yonder
- Posts
- 2,384
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
They have... ;-)
~~IanLast edited by Ian Glass; Sep 11, 2002 at 18:15.
-
Sep 11, 2002, 20:58 #6
- Join Date
- Jan 2002
- Posts
- 178
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
ok well. im wrong
damn! DIE ME YOU BANNED FROM POSTING CAUSE YOU CANT EVEN GET INFO RIGHT!
InQuE
-
Sep 12, 2002, 06:16 #7
- Join Date
- Apr 2002
- Posts
- 75
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
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';
}
}
-
Sep 12, 2002, 07:29 #8
- Join Date
- Mar 2002
- Location
- Svíþjóð
- Posts
- 4,080
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Wow, that's shorter than inserting class="submit" into the only submit button in the form
No, seriously, that javascript can be very useful for input[type="text"] etc.
Bookmarks