Returns a specified Range from a selection. The Range is specified by an index and cannot be greater than the number that is returned by rangeCount.
Method of dom/Selectiondom/Selection
Syntaxvar range = selObj.getRangeAt();
Parameters index
The zero-based index of the range to return. A negative number or a number greater than or equal to rangeCount will result in an error.
Return ValueReturns an object of type RangeRange
The range object that will be returned.
Examplesvar ranges = [];
var selObj = window.getSelection();
for(var i = 0; i < selObj.rangeCount; i++) {
ranges[i] = selObj.getRangeAt(i);
}
Notes Remarks
Currently only Gecko supports multiple or disjointed selections.
Syntax Standards informationMozilla Developer Network : [Selection.getRangeAt Article]
Microsoft Developer Network: [getRangeAt Method Article]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4