How to change the theme in javascript?

They have: 2 posts

Joined: Oct 2016

I am trying to add theme on my web pages on button click, but i am unable to do it.
Would you please tell me how to do it?

They have: 11 posts

Joined: Aug 2016

You will have to modify existing JavaScript either replace with skin file or just add comments on them.

isarbjitgrewal's picture

They have: 8 posts

Joined: May 2017

You can set an Id to the link tag and switch the css at runtime.

HTML

JS

document.getElementById('buttonID').onclick = function () {
document.getElementById('theme_css').href = '../red.css';
};

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.