# Javascript: FrameCollection.getItem Method

> Gets the frame selected by the user or the frame with the specified identifier.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 28.0
- **Path:** TX Text Control .NET Server > Reference > JavaScript API > Javascript: FrameCollection.getItem Method
- **432 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/framecollection/getitem-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/framecollection/getitem-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/framecollection/getitem-method/llms-full.txt

---

### Description

Gets the frame selected by the user or the frame with the specified identifier.

### Syntax

```javascript
<void> FrameCollection.getItem(<RequestFrameBaseCallback> callback, [<ErrorCallback> errorCallback], [<number> id])
```

### Parameters

| Parameter | Description |
|---|---|
| callback | Receives the requested frame or null if there is no frame at the current input position / with the specified identifier. |
| errorCallback | Optional. Is called when the operation failed with an error. |
| id | Optional. The frame's identifier. |

### Examples

The following example demonstrates `FrameCollection.getItem` in a practical document-editing workflow. It gets the frame selected by the user or the frame with the specified identifier.

```javascript
function onTxError(error) {
    console.error("TX Text Control error:", error.msg);
    error.handled = true;
}

function inspectItem(frames) {
    frames.getItem(
        function(frame) {
            if (!frame) {
                console.warn("No frame base was returned.");
                return;
            }
            
            console.log("get item result:", frame);
        },
        onTxError,
        25
    );
}
```

---

## Nearby

- **Previous:** [FrameCollection Object](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/framecollection/llms-full.txt)
- **Next:** [Javascript: FrameCollection.getItemByName Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/framecollection/getitembyname-method/llms-full.txt)
