# Javascript: TXTextControl.setSelectObjects Method

> Sets a value controlling the selection of objects which are inserted behind the text. When the property is set to true, a mouse click selects the object behind the text. Otherwise, when this property is set to false, text in front of the object can be selected.

- **Product:** DS Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 28.0
- **Path:** DS Server > Reference > JavaScript API > Javascript: TXTextControl.setSelectObjects Method
- **411 words**
- **Web URL:** https://docs.textcontrol.com/ds-server/reference/javascript/txtextcontrol/setselectobjects-method/
- **LLMs URL:** https://docs.textcontrol.com/ds-server/reference/javascript/txtextcontrol/setselectobjects-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/ds-server/reference/javascript/txtextcontrol/setselectobjects-method/llms-full.txt

---

### Description

Sets a value controlling the selection of objects which are inserted behind the text. When the property is set to true, a mouse click selects the object behind the text. Otherwise, when this property is set to false, text in front of the object can be selected.

### Syntax

```javascript
<void> TXTextControl.setSelectObjects(<boolean> selectObjects, [<EmptyRequestCallback> callback], [<ErrorCallback> errorCallback])
```

### Parameters

| Parameter | Description |
|---|---|
| selectObjects | Specifies whether the option is active. |
| callback | Optional. Is called when the operation completed. |
| errorCallback | Optional. Is called when the operation failed with an error. |

### Examples

The following example demonstrates `TXTextControl.setSelectObjects` in a practical document-editing workflow. It sets a value controlling the selection of objects which are inserted behind the text. When the property is set to true, a mouse click selects the object behind the text. Otherwise, when this property is set to false, text in front of the object can be selected.

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

TXTextControl.setSelectObjects(
    true,
    function() {
        console.log("set select objects completed.");
    },
    onTxError
);
```

---

## Nearby

- **Previous:** [Javascript: TXTextControl.setRenderMode Method](https://docs.textcontrol.com/ds-server/reference/javascript/txtextcontrol/setrendermode-method/llms-full.txt)
- **Next:** [Javascript: TXTextControl.setStatusBarColor Method](https://docs.textcontrol.com/ds-server/reference/javascript/txtextcontrol/setstatusbarcolor-method/llms-full.txt)
