blob: bb9b76f833844c26d76f8122fcf19d2aa8aae264 [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 "^(5) to (3)|"
selection.collapse(start.firstChild, 4);
selection.extend(end.firstChild, 5);
</script>