You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One of the difficulties here is the semantics of parent selection; you basically need the inverse of the select and selectAll methods. For example, if you select-all a bunch of siblings, and you want to select the parent, you probably just want to select that parent once. On the other hand, if you select-all a bunch of divs, then sub-select a child paragraph for each, when selecting the parent you probably want all the parent divs.
I suppose a general solution would be to detect when the parent nodes are the same, and then coalesce, but the grouping of the nodes is important, too. Should selecting the parent (or the parents) return one group or many? Maybe selectParent and selectParents?
More tree traversal methods are needed. Potentially:
parent
- select parent node.previous
- select previous sibling.next
- select next sibling.firstChild
- select first child.lastChild
- select last child.children
- select all (immediate) children.Some convenience filtering method might also be useful:
first
- filter selection to the first node.last
- filter selection to the last node.slice(start[, end])
- filter selection to the given subset by index.The text was updated successfully, but these errors were encountered: