insertBefore method

This method inserts text before a range. After the text is inserted, the range is expanded to include the new text.

Defined in

TextRange

Syntax

public void insertBefore(String text)

Parameters

String text

Specifies the text to be inserted into the range.

Usage

After calling this method, the text of the range object does not refresh automatically. To avoid any problem, get the range again.

See examples

Example: insertBefore method