Home

# Library goog.dom.Range

Function Summary
| `clearSelection(?Window= opt_win)` Clears the window's selection.
| `clearSelection()`
| `createCaret(?Node node, number offset) ⇒ ?goog.dom.AbstractRange` Create a new range wrapper that represents a caret at the given node, accounting for the given offset. This always creates a TextRange, regardless of whether node is an image node or other control range type node.
| `createFromBrowserRange((Range|TextRange|null) range, boolean= opt_isReversed) ⇒ ?goog.dom.AbstractRange` Create a new range wrapper from the given browser range object.
| `createFromBrowserSelection(!Object selection) ⇒ ?goog.dom.AbstractRange` Create a new range wrapper from the given browser selection object. Note that this object does not auto-update if the user changes their selection and should be used as a snapshot.
| `createFromNodeContents(?Node node, boolean= opt_isReversed) ⇒ ?goog.dom.AbstractRange` Create a new range wrapper that selects the given node's text.
| `createFromNodes(?Node startNode, number startOffset, ?Node endNode, number endOffset) ⇒ ?goog.dom.AbstractRange` Create a new range wrapper that selects the area between the given nodes, accounting for the given offsets.
| `createFromWindow(?Window= opt_win) ⇒ ?goog.dom.AbstractRange` Create a new selection from the given browser window's current selection. Note that this object does not auto-update if the user changes their selection and should be used as a snapshot.
| `hasSelection(?Window= opt_win) ⇒ boolean` Tests if the window has a selection.
| `isReversed(?Node anchorNode, number anchorOffset, ?Node focusNode, number focusOffset) ⇒ boolean` Returns whether the focus position occurs before the anchor position.