DOM:range.selectNodeContents
From MDC
Contents |
[edit] Summary
Sets the Range to contain the contents of a Node.
[edit] Syntax
range.selectNodeContents(referenceNode);
[edit] Parameters
- referenceNode
- The
Nodewhose contents will be selected within aRange
[edit] Example
range = document.createRange();
referenceNode = document.getElementsByTagName("div")[0];
range.selectNodeContents(referenceNode);
[edit] 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.