mercredi 7 décembre 2016

Why is my if-else if statement not working?

I have no clue why it doesn't work, help needed!

function Background1() {
        if (document.body.style.background="linear-gradient(to left, #43C6AC, #191654)") {
            document.body.style.background="linear-gradient(to right, #A180EC, #4babf4)";   
        } else if (document.body.style.background="linear-gradient(to right, #A180EC, #4babf4)") {
            document.body.style.background="linear-gradient(to right, #f79d00, #64f38c)";
        }
    }

Aucun commentaire:

Enregistrer un commentaire