Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defnodefun parents (&optional selector)
- "Get the ancestors of each element, optionally filtered by a selector."
- (loop for parent = (dom:parent-node node) then (dom:parent-node parent)
- while (not (dom:document-p parent))
- if (or (not selector) (css:node-matches? parent selector))
- collect parent))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement