It wouldn't as looks in the opposite direction to jQuery's find() or the Web API's querySelector[All]() - which starts at the Element and then looks at the descendent elements (away from the document root).
The Web API's closest() is complementary as it starts at the Element and then looks at the ancestor elements (towards the document root). See also jQuery's .closest().
It wouldn't as looks in the opposite direction to jQuery's
find()
or the Web API'squerySelector[All]()
- which starts at theElement
and then looks at the descendent elements (away from the document root).The Web API's
closest()
is complementary as it starts at theElement
and then looks at the ancestor elements (towards the document root). See also jQuery's .closest().That being said querySelector() has been around longer than Element.closest().
okay now i understand, really thanks for the entire details, really appericiate your help