Skip to main content
Version: 0.17.0

nearestTo

production

Filters for an element nearest to another element.

Examples:

--------------
| button 1 |
--------------
--------------
| text |
--------------



--------------
| button 2 |
--------------

// Returns button 1 because button 1 is nearer to the text than button 2
...button().nearestTo().text()