Suppose I have this HTML:
<div class="SomeParent" id="BlueParent">
<div>
<div class="Test">test</div>
<div>
</div>
The div of class Test is actually deeply nested in the SomeParent container. What’s the fastest way to get the id of the SomeParent class of which Test is a descendant. Is the .parent() the best way to do it?
Thanks for your suggestions.
Perhaps
http://api.jquery.com/closest/
I don’t know if it would be any faster or slower than thecodeparadox’s solution, however.