这篇翻译不完整。请帮忙从英语翻译这篇文章

Range.selectNodeContents() 方法设置 Range 使其包含一个 Node 的内容。

Range 的 startContainer 属性和 endContainer 属性保存的 Node 将被设置为 referenceNode。 startOffset 为 0,  endOffset 将被设置为 referenceNode 的字符数或子节点个数,具体参见Range.endOffset

Syntax

range.selectNodeContents(referenceNode);

Parameters

referenceNode
Range 要包含的 Node

Example

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

Specifications

Specification Status Comment
DOM
Range.selectNodeContents()
Living Standard No change.
Document Object Model (DOM) Level 2 Traversal and Range Specification
Range.selectNodeContents()
Obsolete Initial specification.

Browser compatibility

We're converting our compatibility data into a machine-readable JSON format. This compatibility table still uses the old format, because we haven't yet converted the data it contains. Find out how you can help!

Feature Chrome Edge Firefox (Gecko) Internet Explorer Opera Safari
Basic support (Yes) (Yes) 1.0 (1.7 or earlier) 9.0 9.0 (Yes)
Feature Android Edge Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support (Yes) (Yes) 1.0 (1.0) 9.0 9.0 (Yes)

See also

文档标签和贡献者

标签: 
此页面的贡献者: gnepnaiL-oahZ, sunly8, AQingC
最后编辑者: gnepnaiL-oahZ,