I'm trying to implement the function for a User to change style of the application.
Index.html
<!DOCTYPE html>
<html>
<head>
<link id="style" rel="stylesheet" type="text/css" href="red-stylesheet.css" />
</head>
</html>
Javascript
function swapStyle(sheet) {
document.getElementById('style').setAttribute('href', sheet);
}
Where sheet
= either blue-stylesheet.css
or red-stylesheet.css
.
It doesn't seem to work. My default theme is red, but when trying to change to blue, ALL styling seems to just disappear, and I can't get the red theme back.
How does one proceed?
(PhoneJS/DevExtreme application)
Default when app is initiated
After pressing "Blue"
Hope this helps :