# getControl Function

> getControl function in the TX Sheet Control JavaScript API for the browser, with the return type SpreadsheetInstance | undefined and a JavaScript example.

- **Product:** TX Sheet Control
- **Section:** Documentation
- **Kind:** Function
- **Path:** TX Sheet Control > API Reference > JavaScript API > Browser Editor > getControl Function
- **293 words**
- **Web URL:** https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/getcontrol-function/
- **LLMs URL:** https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/getcontrol-function/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/getcontrol-function/llms-full.txt

---

Public function for getControl.

Package: `@txtextcontrol/tx-sheet-control`. Version: **2.0.0**.

ES module import: `import { getControl } from '@txtextcontrol/tx-sheet-control';`.

### Syntax

```javascript
getControl(idOrElement)
```

### Parameters

| Parameter | Type | Optional | Description |
|---|---|---|---|
| `idOrElement` | `string \| HTMLElement` | No | Value matching idOrElement's declared type and the owning object's validation rules. |

### Return Value

`SpreadsheetInstance | undefined`.

### Examples

Use this public value with the application package shown below. File and font inputs are application-owned resources, not automatically downloaded product data.

```javascript
import { getControl } from '@txtextcontrol/tx-sheet-control';

const result = getControl('Invoice');
console.log(result);
```

### See Also

- [JavaScript Browser Editor API](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/llms-full.txt)
- [Workbooks and Worksheets](https://docs.textcontrol.com/tx-sheet-control/spreadsheets/workbooks/llms-full.txt)

---

## Nearby

- **Previous:** [germanResources Constant](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/germanresources-constant/llms-full.txt)
- **Next:** [getLanguageResources Function](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/getlanguageresources-function/llms-full.txt)
