The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript From this style to this style?

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • #39183

    Hey everybody.
    Javascript is a very weak point of mine, and I really can’t figure out how I can make a website with a style like this ( to this ( with a click of a button.

    Basically, I need to know how I can make the style of a website change using the onclick function.

    Please let me know.


    Best way to do it is to just add a class to the body and use CSS to change the style:


    Johnny, that’s good. I made this (

    but using your method you can only change the theme ONCE. then the links are rendered useless. And on the website I’m working on it’s not going to make the users very happy knowing they’d have to refresh every time they want to try a theme more than once.

    How do i make it so the links work infinitely?


    Hi GregStevens,
    Here is a pretty straightforward way of accomplishing your task.

    What you need to do is remove the other class when a new theme is clicked.

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.