Some sites should provide the function let the user to change their pages appearance. When the user click the favorite template, the page has no reload, but change to the specific style.
To do this, single line Javascript code is enough:
document.styleSheets(i).href="/new.css";
The variable i indicates the stylesheet link index in the html source. Most simple pages only have one stylesheet, so i should be 0.
For example, the html file(test.html) content:







