--- title: Range.endContainer slug: Web/API/Range/endContainer translation_of: Web/API/Range/endContainer ---
Range.endContainer
是一个只读属性。它会返回{{domxref("Range")}}对象结束的{{domxref("Node")}}。如果要改变一个节点结束的位置,使用方法{{domxref("Range.setEnd()")}}或者相似的方法。
endRangeNode = range.endContainer;
var range = document.createRange(); range.setStart(startNode,startOffset); range.setEnd(endNode,endOffset); endRangeNode = range.endContainer;
Specification | Status | Comment |
---|---|---|
{{SpecName('DOM WHATWG', '#dom-range-endcontainer', 'Range.endContainer')}} | {{Spec2('DOM WHATWG')}} | No change. |
{{SpecName('DOM2 Traversal_Range', 'ranges.html#Level-2-Range-attr-endParent', 'Range.endContainer')}} | {{Spec2('DOM2 Traversal_Range')}} | Initial specification. |
{{CompatibilityTable}}
Feature | Chrome | Edge | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|---|
Basic support | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} | {{CompatGeckoDesktop("1.0")}} | 9.0 | 9.0 | {{CompatVersionUnknown}} |
Feature | Android | Edge | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|
Basic support | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} | {{CompatGeckoMobile("1.0")}} | 9.0 | 9.0 | {{CompatVersionUnknown}} |