main.js:
function changeLogo(element) {
if(element.getAttribute("theme") == "light"){
element.setAttribute("theme", "dark");
document.getElementById('logo').src = "../img/logo_dark.svg";
}else{
element.setAttribute("theme", "light");
document.getElementById('logo').src = "../img/logo.svg";
}
}
html:
<input class="btn-toggle" type="checkbox" onclick="changeLogo(this)" theme="dark">