selectNodeContents
Summary
Sets the Range to contain the contents of a Node.
Syntax
var result = referenceNode.selectNodeContents(/* see parameter list */);
Parameters
referenceNode
- Data-type
- DOM Node
A node in the document hierarchy.
Return Value
Returns an object of type NumberNumber
Type: HRESULT
This method can return one of these values.
| Return code | Description | 
|---|---|
| S_OK | The operation completed successfully. | 
| InvalidStateError | detach has been invoked on the object. | 
Examples
var range = document.createRange();
var referenceNode = document.getElementsByTagName("div")[0];
range.selectNodeContents(referenceNode);
Syntax
range.selectNodeContents(referenceNode);
Standards information
Related specifications
- DOM
- Living Standard
Attributions
- Mozilla Developer Network  : [Range.selectNodeContents Article] : [Range.selectNodeContents Article]
- Microsoft Developer Network: [selectNodeContents Method Article]