blob: 78ccc8465ef061ccd72ee967e9824f9263c8b6f7 [file] [log] [blame]
<!doctype html>
<p id="start"><span style="font-size: 200%; color:red"> [!(5)#]</span>9abcdefghi</p>
<div id="start2">ABC</div>
<p><span style="font-size: 200%; color:red">(a)</span> bc</p>
<div id="end2">DEF</div>
<p id="end"><span style="font-size: 200%; color:red">[!(3)#]</span>789abcd</p>
<script>
const selection = window.getSelection();
const start = document.getElementById('start2');
const end = document.getElementById('end');
// Select "A^BC to 78|9"
selection.collapse(start.firstChild, 1);
selection.extend(end.lastChild, 2);
</script>