Answers
Jan 16, 2008 - 01:00 AM
option.style.cssText += "font-weight: bold";
:(
Jan 17, 2008 - 04:53 AM
From what I can remember, this reason behind this is because of how IE gets the "base" for the HTML Select tag - it's derived from the Win32api - the same reason why dropdownlists and select lists have a nasty habit of rendering "above" everything else on the html page.
I tried the simple example code of :
!
Non-styled 1
Non-styled 2
Styled
Styled inline
In both styling cases, I would see them fine in Firefox, but only the background color was being picked up for the options in IE.
Now, if you feel like being really adventurous, you can check out a workaround presented by Scott Mitchell over here: http://aspnet.4guysfromrolla.com/arti...
I hope this helps,
Ric
Jan 18, 2008 - 12:19 AM
The article didn't really help me out since it's talking about a workaround for a bug in asp.net and I'm just using plain javascript and html, and the problem is beyond the control of asp.net.
Jan 18, 2008 - 03:37 AM
Well, you're right...it wouldn't help much if you're not using .NET for the page.
I did have another thought, though...you could make an unordered list
- "appear" to be a list box with some creative styling. Then you'd have all of your styling options available to you.
It might take some time to fuss around with, but it would certainly be possible. Granted, this isn't a "solution" to the problem in IE - but sadly, as long as IE continues to use the win32api for these two controls, they will always behave badly.
Take care,
Ric
Jan 21, 2008 - 06:26 AM
I just sorted to give the option an slightly different background color, which does work in both FF and IE and that will have to do for now.
Thanks for your help.
Apr 24, 2008 - 12:52 AM
i am facing the same problem . i am trying to get the text in a table cell to bolden on the load event of the form using javascript
document.getElementById("conf").style .fontWeight ="bolder";
document.getElementById("conf").style .color ="black";
where conf is the id of the "td" tag in the table.....works in FF but not in IE.
Add New Comment