Hi I'm making my own website and I want to be able to change the style sheet and content of the page with js.
So I wrote this:
<head>
<link id="style" rel="stylesheet" href="css/index.css">
</head>
<header>
<ul id="nav">
<li> <input id="home" onclick="home()" type="image" src="vzbt.png" widht="55" height="55"></li>
<li> <button id="links" onclick="links()">Links</button> </li>
<li> <button id="about" onclick="about()">About Me</button> </li>
<li> <button id="music" onclick="music()">Music</button> </li>
<li> <button id="contact" onclick="contact()">Contact</button> </li>
</ul>
</header>
This is the js that I wrote so far
function links(){
document.getElementById("style").setAttribute = ("href", links.css);
}
But it doesn't work, so I want to ask if someone can help me? Please.