Given a DOM element how do I find its nearest parent with a given css class?
$('.editButton').click(function() { (magic container selector goes here).addClass('editing'); });
I don’t want to use lots or $(…).parent().parent() since I don’t want to be bound to a particular dom structure.
This should work