When I add class Icon using the if statement it adds it to the correct h3 but also to any h3 elements above the correct one, even if the h3 above is 0. Icon will either be 0 or 1.
{ $('#accordion') .append($('<h3>') .html(Agency));
if (Icon == 1) {
$('h3') .addClass('Icon');
}
AccordionChild = $('<div>');
}
AccordionChild.append("<div>") .html(ToolsList);
$('#accordion').append(AccordionChild);
});
}
Aucun commentaire:
Enregistrer un commentaire