Visit Mozilla.org

DOM:range.selectNodeContents

From MDC

« Gecko DOM Reference

Contents

[edit] Summary

Sets the Range to contain the contents of a Node.

[edit] Syntax

range.selectNodeContents(referenceNode);

[edit] Parameters

referenceNode 
The Node whose contents will be selected within a Range

[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.

[edit] Specification

selectNodeContents