---
title: "isDisabled() | Grafana k6 documentation"
description: "Browser module: elementHandle.isDisabled method"
---

# isDisabled()

> Warning
> 
> Use [`locator.isDisabled([options])`](/docs/k6/latest/javascript-api/k6-browser/locator/isdisabled/) instead.

Checks if the element is disabled.

### Returns

Expand table

| Type            | Description                                                                   |
|-----------------|-------------------------------------------------------------------------------|
| `Promise<bool>` | A Promise that fulfills with `true` if the element is disabled, else `false`. |

### Example

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

```javascript
import { browser } from 'k6/browser';

export const options = {
  scenarios: {
    browser: {
      executor: 'shared-iterations',
      options: {
        browser: {
          type: 'chromium',
        },
      },
    },
  },
};

export default async function () {
  const page = await browser.newPage();
  await page.goto('https://test.k6.io/browser.php');

  const text = await page.$('#input-text-disabled');
  const isDisabled = await text.isDisabled();
  if (isDisabled) {
    console.log('element is disabled');
  }

  await page.close();
}
```
