13 lines
399 B
HTML
13 lines
399 B
HTML
<!doctype html>
|
|
<p>Something to <span>find</span> above</p>
|
|
<p>Something to <span>find</span> in the shadow</p>
|
|
<p>Something to <span>find</span> below</p>
|
|
<script>
|
|
let selection = getSelection();
|
|
selection.removeAllRanges();
|
|
for (let span of document.querySelectorAll("span")) {
|
|
let range = document.createRange();
|
|
range.selectNode(span);
|
|
selection.addRange(range);
|
|
}
|
|
</script>
|