davej Posted October 3, 2012 Share Posted October 3, 2012 I've changed styles using document.getElementById("id").style.xxx But... Can you apply a different _named_ style to an element?Can you apply a different external stylesheet to a page? Thanks. Link to comment Share on other sites More sharing options...
justsomeguy Posted October 3, 2012 Share Posted October 3, 2012 Libraries like jQuery have shortcuts to do that, but each element has a property called either class or className depending on a browser, which contains the contents of the class attribute. You can add and remove classes from that like you would directly on an element tag. To add a new stylesheet you would create a new link element, set the appropriate attributes to have it refer to a stylesheet, and append the link element to the head element. Link to comment Share on other sites More sharing options...
oknoorap Posted October 4, 2012 Share Posted October 4, 2012 You can't apply css to select option, but thanks to jQuery, try to search "jquery selectbox", you'll found what you need. 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