samedi 10 octobre 2020

How can I 'if' condition in docment.getElementById.style.background?

.div_wrap_p_bestgames {
    display: table;
    width: 130px;
    height: 40px;
    float: left;
    background: #1B1C1E;
    position: relative;
    margin-top: 150px;
    margin-left: -100px;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}

this is css code. I want to set div_wrap_p_bestgames's mouseout function if condition with background color #1B1C1E

function onMouseoutNewGames() {
        if (document.getElementById("div_wrap_p_newgames").style.background == "#1B1C1E")
        ///do something
}

this condition is not working

Aucun commentaire:

Enregistrer un commentaire