When I find closest element:
When I find closest element {string} Copy
When I find closest element {string}
Get the first DOM element that matches the selector (whether it be itself or one of its ancestors).
The querying behavior matches exactly how .closest() works in jQuery.
.closest()
Find the closest element with the class banner:
banner
When I find closest element ".banner" Copy
When I find closest element ".banner"
A preceding step like "When I find element by label text" is required. For example:
When I find element by label text "Text" And I find closest element "form" And I submit Copy
When I find element by label text "Text" And I find closest element "form" And I submit
When I find closest element:
Get the first DOM element that matches the selector (whether it be itself or one of its ancestors).
The querying behavior matches exactly how
.closest()
works in jQuery.