I would like to be able to check if a checkbox has been checked against a value in local storage. If it is checked I would like to apply a background colour to a part of the page.
My local storage data looks like the following:
If the completion checkbox is active I would like to apply a green background and if not an orange background.
I have the following code so far but am new to JS and so it needs a lot of work:
function highlightComplete() {
if (DevPlan.completion == 'true') {
info-row.addClass('background-green');
} else if (DevPlan.completion == 'false') {
info-row.addClass('background-orange');
}
}
Any help would be greatly appreciated.
Aucun commentaire:
Enregistrer un commentaire