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