Jump to content

how to change style sheet using javascript?


Recommended Posts

I have 2 style sheets - normal.css and print.css. I am planning on having a link on the page: <a href="currentpage.htm?print">, where currentpage.htm will be the same page the user is on. I want JavaScript to look for ?print (easy enough) and then load the appropriate style sheet based on if ?print exists or not. How can I do this?

The way my style sheet is currently embedded:

<link href='normal.css' rel='stylesheet' type='text/css' title='normal content'>

(this is what would have to change to print.css

Thanks,

-John

Edited by jftuga
Link to comment
Share on other sites


  • 2 weeks later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...