lundi 7 janvier 2019

Jquery if statement executing when it is either false or true

I have this code:

if(($('#1M').attr('class') == 'btn active')){
    ...code here...
}

Either if the class is the same or not, it enter the IF.

I tried checking with console log the code as above and it shows correctly true or false.

Aucun commentaire:

Enregistrer un commentaire