---
title: "Response.clickLink( [params] ) | Grafana k6 documentation"
description: "Create and make a request corresponding to a link, found in the HTML of response, being clicked."
---

> For a curated documentation index, see [llms.txt](/llms.txt). For the complete documentation index, see [llms-full.txt](/llms-full.txt).

# Response.clickLink( \[params] )

Create and make a request corresponding to a link, found in the HTML of response, being clicked. By default it will look for the first `a` tag with a `href` attribute in the HTML, but this can be overridden using the `selector` option.

This method takes an object argument where the following properties can be set:

Expand table

| Param    | Type   | Description                                                                                                                                                                         |
|----------|--------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| selector | string | A selector string passed to [Selection.find(selector)](/docs/k6/next/javascript-api/k6-html/selection/selection-find/) to locate the link to click. By default this is `"a[href]"`. |
| params   | object | A [Params](/docs/k6/next/javascript-api/k6-http/params/) object that will be forwarded to the link click request. Can be used to set headers, cookies etc.                          |

### Returns

Expand table

| Type                                                       | Description             |
|------------------------------------------------------------|-------------------------|
| [Response](/docs/k6/next/javascript-api/k6-http/response/) | The link click response |

### Example

JavaScript ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```javascript
import http from 'k6/http';

export default function () {
  // Request page with links
  let res = http.get('https://quickpizza.grafana.com/admin');

  // Now, click the 4th link on the page
  res = res.clickLink({ selector: 'a:nth-child(1)' });
}
```
