mjsulliv Posted February 11, 2010 Report 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 Report 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 Report 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 Report 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
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now