commit
1fa08bc754
1 changed files with 1 additions and 1 deletions
|
@ -142,7 +142,7 @@ For instance:
|
|||
|
||||
*Ancestors* of an element are: parent, the parent of parent, its parent and so on. The ancestors together form the chain of parents from the element to the top.
|
||||
|
||||
The method `elem.closest(css)` looks the nearest ancestor that matches the CSS-selector. The `elem` itself is also included in the search.
|
||||
The method `elem.closest(css)` looks for the nearest ancestor that matches the CSS-selector. The `elem` itself is also included in the search.
|
||||
|
||||
In other words, the method `closest` goes up from the element and checks each of parents. If it matches the selector, then the search stops, and the ancestor is returned.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue