const range = document.createRange();
range.setStart(startNode, startOffset);
range.setEnd(endNode, endOffset);
const isCollapsed = range.collapsed;AbstractRange: collapsed property / notebook
AbstractRange: collapsed property
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.