New to Telerik UI for ASP.NET AJAX? Start a free 30-day trial

Definition

Namespace:Telerik.Web.UI.Editor

Inheritance: Telerik.Web.UI.Editor.DomRange

Methods

Clears the selection of the browser.

JS
clear(): void

Creates a new DomRange object that has the same selected area

JS
cloneRange(): Telerik.Web.UI.Editor.DomRange
Returns:

Telerik.Web.UI.Editor.DomRange

Collapses the range to either end. When collapsed, start and end locations are identical.

JS
collapse(Boolean toStart): void
Parameters:toStartBoolean

If true, range is collapsed to the start location. Otherwise, collapses to the end location.

The parent node that fully contains the range content

JS
static commonAncestorContainer `Element`(): void

Creates a range from the page's document

JS
static createRange(Object range): Telerik.Web.UI.Editor.DomRange
Parameters:rangeObject

The page document, for which a range will be created

Returns:

Telerik.Web.UI.Editor.DomRange

Delete the content of the range

JS
deleteContents(): void

The end container (node), where the end location of the range is located.

JS
static endContainer `Element`(): void

The end offset within the end container of the range's end location

JS
static endOffset `Number`(): void

Extract the content of the range

JS
extractContents(): Object
Returns:

Object

Result is a documentFragment

Gets the underlying browser range reference. It is different for legacy IE and modern browsers.

JS
getBrowserRange(): Object
Returns:

Object

Gets the content of the range as HTML text content.

JS
getHtml(): String
Returns:

String

Gets the range content as text. HTML tags are expected to be missing.

JS
getText(): String
Returns:

String

Insert a DOM node at the start of the range

JS
insertNode(Element node): void
Parameters:nodeElement

The node to be inserted

Checks whether the range is collapsed.

JS
isCollapsed(): Boolean
Returns:

Boolean

True means the range is collapsed. Otherwise, false.

Enters text content as range content. Input could be HTML text.

JS
pasteHTML(String text): void
Parameters:textString

The content to be pasted in the range

Gets the range of the specified browser window

JS
static rangeFromWindow(Object wndow): Telerik.Web.UI.Editor.DomRange
Parameters:wndowObject

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.

JS
select(): void

Selection is applied over the specified node.

JS
selectNode(Element node): void
Parameters:nodeElement

The node to be selected

Select the whole content of a node

JS
selectNodeContents(Element node): void
Parameters:nodeElement

The node, which content should be selected

Set the end of the range at a specific location in the DOM tree

JS
setEnd(Element node, Number offset): void
Parameters:nodeElement

The node, where the end should be located

offsetNumber

The offset within the DOM node

Set the end of the range after the specified node

JS
setEndAfter(Element node): void
Parameters:nodeElement

The node, after which the end of the range will be set

Set the end of the range before the specified node

JS
setEndBefore(Element node): void
Parameters:nodeElement

The node, before which the range end will be set

Set the start of the range at a specific location in the DOM tree

JS
setStart(Element node, Number offset): void
Parameters:nodeElement

The node, where the start should be located

offsetNumber

The offset within the DOM node

Sets the start of the range before the specified node

JS
setStartAfter(Element node): void
Parameters:nodeElement

The node, before which the start should be located

Sets the start of the range before the specified node

JS
setStartBefore(Element node): void
Parameters:nodeElement

The node, before which the start should be located

The start container (node), where the start location of the range is located.

JS
static startContainer `Element`(): void

The start offset within the start container of the range's start location

JS
static startOffset `Number`(): void

Surrounds the selected range content with the provided node

JS
surroundContents(Element newParent): void
Parameters:newParentElement

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.

JS
static toDomRange(Object range): Telerik.Web.UI.Editor.DomRange
Parameters:rangeObject

The range that could potentially be wrapped in a DomRange, if it is a browser range.

Returns:

Telerik.Web.UI.Editor.DomRange

Not finding the help you need?
Contact Support