Definition
Namespace:Telerik.Web.UI.Editor
Inheritance: Telerik.Web.UI.Editor.DomRange
Methods
Clears the selection of the browser.
clear(): void
Creates a new DomRange object that has the same selected area
cloneRange(): Telerik.Web.UI.Editor.DomRange
Telerik.Web.UI.Editor.DomRange
Collapses the range to either end. When collapsed, start and end locations are identical.
collapse(Boolean toStart): void
If true, range is collapsed to the start location. Otherwise, collapses to the end location.
The parent node that fully contains the range content
static commonAncestorContainer `Element`(): void
Creates a range from the page's document
static createRange(Object range): Telerik.Web.UI.Editor.DomRange
The page document, for which a range will be created
Returns:Telerik.Web.UI.Editor.DomRange
Delete the content of the range
deleteContents(): void
The end container (node), where the end location of the range is located.
static endContainer `Element`(): void
The end offset within the end container of the range's end location
static endOffset `Number`(): void
Extract the content of the range
extractContents(): Object
Object
Result is a documentFragment
Gets the underlying browser range reference. It is different for legacy IE and modern browsers.
getBrowserRange(): Object
Object
Gets the content of the range as HTML text content.
getHtml(): String
String
Gets the range content as text. HTML tags are expected to be missing.
getText(): String
String
Insert a DOM node at the start of the range
insertNode(Element node): void
The node to be inserted
Checks whether the range is collapsed.
isCollapsed(): Boolean
Boolean
True means the range is collapsed. Otherwise, false.
Enters text content as range content. Input could be HTML text.
pasteHTML(String text): void
The content to be pasted in the range
Gets the range of the specified browser window
static rangeFromWindow(Object wndow): Telerik.Web.UI.Editor.DomRange
The page window object reference
Returns:Telerik.Web.UI.Editor.DomRange
Puts the content of the range in a browser selection. The content should be wrapped in a UI selection by the browser.
select(): void
Selection is applied over the specified node.
selectNode(Element node): void
The node to be selected
Select the whole content of a node
selectNodeContents(Element node): void
The node, which content should be selected
Set the end of the range at a specific location in the DOM tree
setEnd(Element node, Number offset): void
The node, where the end should be located
offsetNumberThe offset within the DOM node
Set the end of the range after the specified node
setEndAfter(Element node): void
The node, after which the end of the range will be set
Set the end of the range before the specified node
setEndBefore(Element node): void
The node, before which the range end will be set
Set the start of the range at a specific location in the DOM tree
setStart(Element node, Number offset): void
The node, where the start should be located
offsetNumberThe offset within the DOM node
Sets the start of the range before the specified node
setStartAfter(Element node): void
The node, before which the start should be located
Sets the start of the range before the specified node
setStartBefore(Element node): void
The node, before which the start should be located
The start container (node), where the start location of the range is located.
static startContainer `Element`(): void
The start offset within the start container of the range's start location
static startOffset `Number`(): void
Surrounds the selected range content with the provided node
surroundContents(Element newParent): void
The new parent of the range content
Wrapper method that always returns DomRange. Useful when one is not sure if the range is a DomRange or a regular browser range.
static toDomRange(Object range): Telerik.Web.UI.Editor.DomRange
The range that could potentially be wrapped in a DomRange, if it is a browser range.
Returns:Telerik.Web.UI.Editor.DomRange