Skip to main content
Version: 0.18.1

below

production

Filters for an element below another element.

Takes an optional parameter index to select the nth element (starting with 0)

Examples:

--------------
| text |
--------------
--------------
| button0 |
--------------
--------------
| button1 |
--------------

// Returns button0 because button0 is the first button below text
...button().below().text()
...button().below(0).text()
// Returns button1 because button1 is the second button below text
...button().below(1).text()
// Returns no element because text is above button
...text().below().button()

  • @param {number} [optionalIndex=0] - element index