script tag anywhere after that
link, you can indeed update its
document.getElementById("css1").href = "demo2.css";
Normally, it's best to put your
script tags at the end, just before the closing
</body> tag. In your case, since you're changing CSS, to avoid having the previous styling "flashing" at the user, you might want it higher up so it's handled sooner, though.