Home | Top | Website design | JavaScript Editor JavaScript EditorGet Advanced
JavaScript and Ajax Editor,
Validator and Debugger!

1st JavaScript Editor.


selectNodeContents Method

Sets the Range to contain the contents of a Node.

Syntax

range.selectNodeContents(referenceNode);
 

Parameters

The selectNodeContents method takes the following parameters:

referenceNode
 

The Node whose contents will be selected within a Range


Example

range = document.createRange();
 
referenceNode = document.getElementsByTagName("div").item(0);
 
range.selectNodeContents(referenceNode);
 

Notes

The parent Node of the start and end of the Range will be the referenceNode. The startOffset is 0, and the endOffset is the number of child Nodes or number of characters contained in the reference node.

Specification

selectNodeContents

Home | Top | Website design | JavaScript Editor JavaScript EditorGet Advanced
JavaScript and Ajax Editor,
Validator and Debugger!

1st JavaScript Editor.

Bitcoin Dice Site