Question

Suppose the jQuery object is $obj,how to select the desired ancestor?

Was it helpful?

Solution

Use parents() with the :first selector:

obj.parents("tbody:first");
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top