Reputation: 1482
I have a simple toggle that's going to be applied to more than one section of my web application. However, I do not want to just change the class name and add another event to trigger it.
Can I use something like parent()
or nextUntil()
to achieve this? What is usually the best practice for this situation?
https://jsfiddle.net/smod3dvp/
Upvotes: 0
Views: 21
Reputation: 1333
use parents to find common identifiable parent and then use find like
$(this).parents(".information").find(".details").fadeToggle("fast");
Upvotes: 1