Clear Up
SharpKit Reference

Range Class

See also the Document Object Model (DOM) Level 2 Traversal and Range Specification. @since DOM Level 2

Namespace: SharpKit.Html

Base Types



Name Description


Name Description
collapsed TRUE if the Range is collapsed
commonAncestorContainer The deepest common ancestor container of the Range's two boundary-points.
endContainer Node within which the Range ends
endOffset Offset within the ending node of the Range.
startContainer Node within which the Range begins
startOffset Offset within the starting node of the Range.


Name Description
cloneContents() Duplicates the contents of a Range
cloneRange() Produces a new Range whose boundary-points are equal to the boundary-points of the Range.
collapse(bool) Collapse a Range onto one of its boundary-points
compareBoundaryPoints(Int16, Range) Compare the boundary-points of two Ranges in a document.
deleteContents() Removes the contents of a Range from the containing document or document fragment without returning a reference to the removed content.
detach() Called to indicate that the Range is no longer in use and that the implementation may relinquish any resources associated with this Range. Subsequent calls to any methods or attribute getters on this Range will result in a
being thrown with an error code of
extractContents() Moves the contents of a Range from the containing document or document fragment to a new DocumentFragment.
insertNode(Node) Inserts a node into the Document or DocumentFragment at the start of the Range. If the container is a Text node, this will be split at the start of the Range (as if the Text node's splitText method was performed at the insertion point) and the insertion will occur between the two resulting Text nodes. Adjacent Text nodes will not be automatically merged. If the node to be inserted is a DocumentFragment node, the children will be inserted rather than the DocumentFragment node itself.
selectNode(Node) Select a node and its contents
selectNodeContents(Node) Select the contents within a node
setEnd(Node, int) Sets the attributes describing the end of a Range.
setStart(Node, int) Sets the attributes describing the start of the Range.
surroundContents(Node) Reparents the contents of the Range to the given node and inserts the node at the position of the start of the Range.
© Copyright 2005-2011 SharpKit. All rights reserved.