We're looking for a user researcher to understand the needs of developers and designers. Is this you or someone you know? Check out the post: https://mzl.la/2IGzdXS

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

只读属性 Range.endOffset 返回代表 Range 结束位置在 Range.endContainer 中的偏移值的数字。

如果 endContainerNode 类型为 Text, Comment,或 CDATASection,偏移值是 endContainer 节点开头到 Range 末尾的总字符个数。对其他类型的 NodeendOffsetendContainer 开头到 Range 末尾的总 Node 个数。这是个只读属性,要改变它, 请使用 Range.setEnd 方法。

Syntax

endRangeOffset = range.endOffset;

Example

var range = document.createRange();

range.setStart(startNode,startOffset);
range.setEnd(endNode,endOffset);
endRangeOffset = range.endOffset;

Specifications

Specification Status Comment
DOM
Range.endOffset
Living Standard No change.
Document Object Model (DOM) Level 2 Traversal and Range Specification
Range.endOffset
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
最后编辑者: gnepnaiL-oahZ,