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

调用 Range.selectNode() 方法后, Range 设置为包含整个 Node 。此 RangestartContainer 属性和 endContainer 属性保存的 Node 将设置为 referenceNode 的父节点。

语法

range.selectNode(referenceNode);

参数

referenceNode
Range 要包含的 Node

举例

var range = document.createRange();
var referenceNode = document.getElementsByTagName("div").item(0);

range.selectNode(referenceNode);

规范

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

浏览器兼容性

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)

参考资料

文档标签和贡献者

此页面的贡献者: gnepnaiL-oahZ, Mark_Zhang
最后编辑者: gnepnaiL-oahZ,