> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bringits.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Click by Javascript

> Select DOM elements by locator and click them via element.click()

The Click by Javascript command (Command Type: 3) selects elements using an `ElementsLocator` and clicks them programmatically via JavaScript's `element.click()`.

## Command Type

**Command Type ID:** 3

## Parameters

| Parameter           | Type            | Description                               | Required |
| ------------------- | --------------- | ----------------------------------------- | -------- |
| **elementsLocator** | ElementsLocator | Defines how to locate the target elements | Yes      |
| **timeout**         | number          | Timeout for the command in milliseconds   | Yes      |

### ElementsLocator

| Field            | Type            | Description                                              | Required |
| ---------------- | --------------- | -------------------------------------------------------- | -------- |
| **selector**     | string          | CSS selector (used with `document.querySelectorAll()`)   | Yes      |
| **continueWith** | ElementsLocator | Continue search within the found element                 | No       |
| **hasChildren**  | ElementsLocator | Filter elements that have children matching this locator | No       |
| **index**        | number          | Select a specific element by index when multiple match   | No       |
| **innerText**    | string          | Filter elements by inner text                            | No       |

## Usage Examples

### Click a Tab

```json theme={null}
{
  "command": "click-by-javascript",
  "params": {
    "elementsLocator": { "selector": "[data-test='tab--football']" },
    "timeout": 10000
  }
}
```

### Click by Inner Text

```json theme={null}
{
  "command": "click-by-javascript",
  "params": {
    "elementsLocator": {
      "selector": ".nav-item",
      "innerText": "Live"
    },
    "timeout": 10000
  }
}
```

## Related Commands

* [Mouse Click On Elements](/stream/commands/interaction/mouse-click-on-elements) - Human-like mouse click
* [Wait For DOM Element](/stream/commands/browser/wait-for-dom-element) - Wait before clicking
