Range.cloneRange()

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

Range.cloneRange()方法返回一个range对象,并且该对象的范围边界点与被克隆的range对象相同。

克隆的对象是复制过来的,而非引用,所以这两个对象双方各自做出的改变,都不会影响另一方。

语法

clone = range.cloneRange();

Example

range = document.createRange();
range.selectNode(document.getElementsByTagName("div").item(0));
clone = range.cloneRange();

Specifications

Specification Status Comment
DOM
Range.cloneRange()
Living Standard No change.
Document Object Model (DOM) Level 2 Traversal and Range Specification
Range.cloneRange()
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

文档标签和贡献者

标签: 
 此页面的贡献者: Jemory
 最后编辑者: Jemory,