Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Element::closest #23

Closed
g105b opened this issue Feb 24, 2016 · 2 comments
Closed

Element::closest #23

g105b opened this issue Feb 24, 2016 · 2 comments
Labels
enhancement Improvement to existing functionality

Comments

@g105b
Copy link
Member

g105b commented Feb 24, 2016

https://developer.mozilla.org/en-US/docs/Web/API/Element/closest

The Element.closest() method returns the closest ancestor of the current element (or the current element itself) which matches the selectors given in parameter. If there isn't such an ancestor, it returns null.

@g105b g105b added enhancement Improvement to existing functionality good-starter-issue labels Feb 24, 2016
aguimaraes added a commit to aguimaraes/dom that referenced this issue May 18, 2016
g105b added a commit that referenced this issue May 20, 2016
Element::closest() implementation. Close issue #23
@g105b g105b closed this as completed May 20, 2016
@g105b
Copy link
Member Author

g105b commented May 20, 2016

Thanks Álvaro for your contributions!

g105b added a commit that referenced this issue May 25, 2016
@g105b
Copy link
Member Author

g105b commented May 25, 2016

I wonder if a neater way to check for the "closest" element would be to iterate up the parentNode in combination with the matches() function? What do you think @aguimaraes ?

g105b added a commit that referenced this issue May 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvement to existing functionality
Projects
None yet
Development

No branches or pull requests

1 participant