> For the complete documentation index, see [llms.txt](https://gebra-it.gitbook.io/wiki/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gebra-it.gitbook.io/wiki/client-api-reference/functions/setfocus.md).

# setFocus

Sets the cursor focus to a specific control and optionally selects the existing text.

## Parameters

1. controlId - the name of the control to set the focus to
2. select - (optional) if set to true, the existing text in the control is selected. if empty or false, the cursor is placed behind the not selected text

## Example Usages

```javascript
app.setFocus("adrName"); //set focus and place cursor after existing text
app.setFocus("adrName", true); //set focus and select the existing text
```

### Return Values

Function does not explicitly produce return value.
