Dan Ross
Dan Ross

Reputation: 45

Add Class to another element when class is added to body

I am trying to check for when a class is added to the body but my code isn't working, is anyone able to help me?

function checkFordone() {
    if ($("body").hasClass("done")) {
        $("#mainbar").addclass("finished");
    } else {
        setTimeout(checkFordone, 100);
    }
}

jsFiddle

Upvotes: 0

Views: 54

Answers (1)

VA79
VA79

Reputation: 484

addclass is not a function use addClass!

Upvotes: 3

Related Questions