jeudi 23 janvier 2020

If ID has style Attribute add Class to body

I want to add a new Class to body if an ID has a specific style attriute using jQuery. Why is this code not working:

if ($('#myID').css('display') == 'none'){
       $('body').addClass('loaded');
    }

Thank you in advance!




Aucun commentaire:

Enregistrer un commentaire