So, I am trying to add a class to UL depending on the text used in navigation.
For example.
<li> <a href="#">Text</a> <ul> </ul> </li>
I want to add a class to ul depending on the text inside the tag, to find the text that I just use: contains a method
$('#nav > li > a:contains("text")')
After that, I draw a space on how to add the class to the next line, I thought .next might work, but it turns out that it is not.
Any help would be greatly appreciated!
rizzy
source share