vendredi 25 novembre 2016

Unexpected token if in my page

i have a problem with my JS, i have a short code but i have an error... This is my code, and the error message is "Uncaught SyntaxError: Unexpected token if"

$( ".boxes" ).each if $(this)attr('index') <= jour {
    $(this).addClass("ouvert");
}

I've tried to make this :

$(".boxes").each(function () {
    if ($(this).attr('index') <= jour ) {
        $(".day-Content img").addClass('ouvert')
    }
})

But nos results...

Thank you so much for your help !

Aucun commentaire:

Enregistrer un commentaire