Tecfan Posted October 15, 2006 Share Posted October 15, 2006 How do I load stylesheets with javascript? function loadStylesheet(){...} The HTMLcode for it is: <link rel="stylesheet" type="text/css" media="screen" href="you.css" /> Link to comment Share on other sites More sharing options...
Tecfan Posted October 15, 2006 Author Share Posted October 15, 2006 got the answer, *deletepost* Link to comment Share on other sites More sharing options...
jesh Posted October 16, 2006 Share Posted October 16, 2006 Maybe you could post the answer here in case someone else has a similar problem. Link to comment Share on other sites More sharing options...
aspnetguy Posted October 16, 2006 Share Posted October 16, 2006 assuming there is only 1 <link> on your page function loadCss(){ var css = document.getElementsByTagName('link')[0]; css.href = 'yourstyle.css';} 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