Here\'s the markup i\'m trying to query. So given the markup:
8条回答 没有蜡笔的小新 (楼主) 2020-12-06 01:04 To add an updated answer, there is now Element.closest() available. https://developer.mozilla.org/en-US/docs/Web/API/Element/closest This isn't supported on IE, but that mozilla doc page includes code for a polyfill for IE8 and IE9+. 0 讨论(0) 查看其它8个回答 发布评论: 提交评论 加载中... 验证码 看不清? 提交回复 热议问题
To add an updated answer, there is now Element.closest() available.
Element.closest()
https://developer.mozilla.org/en-US/docs/Web/API/Element/closest
This isn't supported on IE, but that mozilla doc page includes code for a polyfill for IE8 and IE9+.