mjsulliv Posted February 11, 2010 Share Posted February 11, 2010 I use JS to build the contents of a select element: selectElementID.options[0].text = "None"; selectElementID.options[0].value = "None"; I also want to set the text's color.Any thoughts will be appreciated.Thanks --- Mike Link to comment Share on other sites More sharing options...
justsomeguy Posted February 11, 2010 Share Posted February 11, 2010 You can set the CSS color property, but not all browsers support styling of select options.selectElementID.options[0].style.color = '#FF0000'; Link to comment Share on other sites More sharing options...
jeffman Posted February 11, 2010 Share Posted February 11, 2010 You can often force a select element into a stylable version if you mess with things like background and border. Just changing an option's color isn't usually enough to do it. Link to comment Share on other sites More sharing options...
mjsulliv Posted February 12, 2010 Author Share Posted February 12, 2010 You can set the CSS color property, but not all browsers support styling of select options.selectElementID.options[0].style.color = '#FF0000';That works well, thanks! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.