Range.endContainer
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since March 2017.
Range.endContainer
是一个只读属性。它会返回Range
对象结束的Node
。如果要改变一个节点结束的位置,使用方法Range.setEnd()
或者相似的方法。
语法
endRangeNode = range.endContainer;
示例
js
var range = document.createRange();
range.setStart(startNode, startOffset);
range.setEnd(endNode, endOffset);
endRangeNode = range.endContainer;
规范
Specification |
---|
DOM # ref-for-dom-range-endcontainer① |
浏览器兼容性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
endContainer |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.