Sorry if it's such a basic question for some of you but I'm struggling.
Here is what I'm trying:
var hasPurple = $(this).attr('data-attrs','{"attribute_pa_flavours":"lavender"}');
$(function () {
if ($(hasPurple !== undefined && hasPurple !== false)) {
$(this).attr('style','background-color: purple');
} else {
}
})
Aucun commentaire:
Enregistrer un commentaire