Interactive editor
Explore Selection
Retrieve and set the active document selection through the JavaScript API.
Ready to tryUse the controls above to interact with this demo.
What this demonstrates
Selection
Retrieve and set the active document selection through the JavaScript API.
API used
TXTextControl.selection
How it works
The sample loads deterministic plain text, sets an exact selection range, and replaces only that range through Selection.load. The rest of the document remains unchanged.
Source files
See the implementation
The view, browser behavior, and controller are encapsulated in Demos/RichTextEditor/Editing/Selection.