Source code
Revision control
Copy as Markdown
Other Tools
<!doctype html>
<span id="outer">Outer</span>
<div>
<span id="slotted">Slotted</span>
<span id="inner">Inner</span>
</div>
<script>
window.getSelection()
.setBaseAndExtent(outer.firstChild, 3, slotted.firstChild, 4);
const range = new Range();
range.selectNode(inner);
window.getSelection().addRange(range);
</script>