Readonly
collapsedThe read-only collapsed
property of the AbstractRange interface returns true
if the range's start position and end position are the same.
Readonly
commonThe Range.commonAncestorContainer
read-only property returns the deepest — or furthest down the document tree — Node that contains both boundary points of the Range.
Readonly
END_Readonly
END_Readonly
endThe read-only endContainer
property of the AbstractRange interface returns the Node in which the end of the range is located.
Readonly
endThe endOffset
property of the AbstractRange interface returns the offset into the end node of the range's end position.
Readonly
START_Readonly
START_Readonly
startThe read-only startContainer
property of the AbstractRange interface returns the start Node for the range.
Readonly
startThe read-only startOffset
property of the AbstractRange interface returns the offset into the start node of the range's start position.
The cloneContents()
method of the Range interface copies the selected Node children of the range's Range/commonAncestorContainer and puts them in a new DocumentFragment object.
The Range.cloneRange()
method returns a The returned clone is copied by value, not reference, so a change in either js-nolint cloneRange()
None.
The collapse()
method of the Range interface collapses the A collapsed Range is empty, containing no content, specifying a single-point in a DOM tree.
Optional
toStart: booleanThe compareBoundaryPoints()
method of the Range interface compares the boundary points of the Range with those of another range.
The comparePoint()
method of the Range interface determines whether a specified point is before, within, or after the Range.
The Range.createContextualFragment()
method returns a XML fragment parsing algorithm with the start of the range (the parent of the selected node) as the context node.
The Range.deleteContents()
method removes all completely-selected Node within this range from the document.
The Range.detach()
method does nothing.
The extractContents()
method of the Range interface is similar to a combination of Range.cloneContents() and Range.deleteContents().
The Range.getBoundingClientRect()
method returns a DOMRect object that bounds the contents of the range; this is a rectangle enclosing the union of the bounding rectangles for all the elements in the range.
The Range.getClientRects()
method returns a list of DOMRect objects representing the area of the screen occupied by the range.
The Range.insertNode()
method inserts a node at the start of the Range.
The Range.intersectsNode()
method returns a boolean indicating whether the given Node intersects the Range.
The isPointInRange()
method of the Range interface determines whether a specified point is within the Range.
The Range.selectNode()
method sets the the parent of the referenceNode.
The Range.selectNodeContents()
method sets the Range to contain the contents of a Node.
The Range.setEnd()
method sets the end position of a Range to be located at the given offset into the specified node.
The Range.setEndAfter()
method sets the end position of a Node
of end of the Range
will be the same as that for the referenceNode
.
The Range.setEndBefore()
method sets the end position of a Range
relative to another Node.
The Range.setStart()
method sets the start position of a If the startNode
is a Node of type Text, the number of characters from the start of startNode
.
The Range.setStartAfter()
method sets the start position of a Range relative to a Node.
The Range.setStartBefore()
method sets the start position of a Range relative to another Node.
The surroundContents()
method of the Range interface surrounds the selected content by a provided node.
Returns a string representation of an object.
The
Range
interface represents a fragment of a document that can contain nodes and parts of text nodes.MDN Reference