# Javascript: LineCollection.getItemAtLocation Method

> Gets the line at a certain geometrical position.

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

---

### Description

Gets the line at a certain geometrical position.

### Syntax

```javascript
<void> LineCollection.getItemAtLocation(<number> x, <number> y, <RequestLineCallback> callback, [<ErrorCallback> errorCallback])
```

### Parameters

| Parameter | Description |
|---|---|
| x | Specifies the line's horizontal location in pixels with an origin at the top left corner of the corner. |
| y | Specifies the line's vertical location in pixels with an origin at the top left corner of the corner. |
| callback | Receives the line at a certain geometrical position. |
| errorCallback | Optional. Is called when the operation failed with an error. |

### Examples

The following example demonstrates `LineCollection.getItemAtLocation` in a practical document-editing workflow. It gets the line at a certain geometrical position.

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

function inspectItemAtLocation(lines) {
    lines.getItemAtLocation(
        1,
        1,
        function(result) {
            if (!result) {
                console.warn("No line was returned.");
                return;
            }
            
            console.log("get item at location result:", result);
        },
        onTxError
    );
}
```

---

## Nearby

- **Previous:** [Javascript: LineCollection.getItem Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/linecollection/getitem-method/llms-full.txt)
- **Next:** [ListFormat Object](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/listformat/llms-full.txt)
