Skip to main content
1 de 2

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">