Closed
Description
I am trying to apply the Closest
selector method to a set of matched elements and expecting to get one closest ancestor per matched element (in cases where such an ancestor exists), but only the first one is getting matched.
Assuming document
is a valid CQ
document object, I am making a call similar to the following:
var links = document["a"];
var closest = links.Closest["td"];
In my case, almost all of the elements selected in links
should have a td
ancestor, but I am only getting the first one back.