AbstractRange: endContainer property

فهرست فصل‌ها دانلود آرشیوناشر

MDN Web Docs · نسخهٔ df622a2a1c1e · CC BY-SA 2.5 و مجوز جداگانهٔ ناشر برای نمونه‌کد

{{APIRef("DOM")}}

The read-only **endContainer** property of the {{domxref("AbstractRange")}} interface returns the {{domxref("Node")}} in which the end of the range is located.

To change the end position, use the {{domxref("Range.setEnd()")}} method or a similar one.

Value

The {{domxref("Node")}} which contains the last character of the range.

Example

js
const range = document.createRange();
range.setStart(startNode, startOffset);
range.setEnd(endNode, endOffset);

const endRangeNode = range.endContainer;

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}