TOC PREV NEXT INDEX

domref



selectNodeContents


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


Netscape Communications
http://developer.netscape.com
TOC PREV NEXT INDEX