createRangeCollection method

Creates a TextRange object collection from the current selection.

Syntax

var retval = selection.createRangeCollection();

Parameters

This method has no parameters.

Return value

Type: Object

Returns a collection of TextRange objects.

Standards information

There are no standards that apply here.

Remarks

Host applications can provide a multiple selection mechanism and can return a collection of TextRange objects that represents discontinuous selections.

Examples

The following example displays the text of the first selected item.


var myCollection;
myCollection = document.selection.createRangeCollection();
console.log( myCollection.item(0).text );


See also

selection
ISelectionServices
ISegmentList

 

 

Show:
© 2014 Microsoft