I need to write an if-statement in jQuery that checks whether list items with a certain class (the "sec" class) have a value assignment of NOT "null" for a particular property (the "parentsecid" property). If a list item does meet this condition (namely -- the value is a number rather than 'null'), I then want to give that particular list item an additional class assignment (the "subsec" class).
The screen shot below is taken from the actual list and you can see how some list items meet the condition in question, and some do not.
Thanks in advance for your advice. I know this should be a fairly basic thing to achieve, and I have actually had some success with assigning CSS classes to elements via jQuery, but I am struggling a bit with this because it involves an If statement.

Aucun commentaire:
Enregistrer un commentaire