JavaScriptAPI : Range

Range is an object that specifies a range of text in the TextActionContext. Ranges are defined by a zero-based character index (the location), and a length.

Range(location, length)

The Range constructor accepts a zero-based character index location and a length. For instance, to specify the first 10 characters in a document you would use the following Range:

var range = new Range(010); 

Read-only properties

  • location: the zero-based character index where this range starts
  • length: the length of the range. Can be 0 if the range represents a cursor rather than a selection