I am trying to add a "dark mode/light mode". I am trying to do this by using two different CSS style sheets and having a single button to click through them
ive tried using setAttribute, innerHTML, removeAtribute( moving the contents of one style sheet into tags and trying to remove one stylesheet)
change to Light Mode
function light(){
document.getElementById(css).setAttribute("href", "LIGHTMODE.CSS")
document.getElementById(darkmode).innerHTML="Change to Light Mode"
document.getElementById(darkmode).onclick="dark()"
cos
}
function dark(){
document.getElementById(css).href = "LIGHTMODE.CSS"
document.getElementById(darkmode).innerHTML="Change to Dark Mode"
document.getElementById(darkmode).onclick ="light()"
console.log(darkmode)
}
It should identify the throught the Id and change the href to whatever is stated