- I've got a list similar to the following:
- Item 2-5 needs to have a class added either to the a or the li using jquery I've tried the following but it isn't working:
I'm new to this jquery malarkey so I'm shooting in the dark somewhat here so if anyone can point me in the right direction is would be most appreciated.
I should mention that there'll be a few of these nested lists, the parents (li) of which will all need a class added via jquery.
I know I originally gave incorrect details and I apologise for that. If what I'm trying to achieve really isn't possible then please tell me so I'm not going on a wild goose chase. Thanks.
Thanks for the suggestion but there'll be other subcategories created over time by my client and ideally I need a method of adding the class regardless of the link each time a new subcategory is added.
Good grief yes! Sorry, I'm overworked and underslept...that's my excuse anyway. Yes that is exactly what I want styled and I'm sorry to send you on a wild goose chase.
How will the current link be determined?
Any ideas? I'm still somewhat at a loose end with this menu and some more help would be most appreciated.
In that case wouldn't you want the class added to item-2, instead of item-2-5?