Skip to content

Truly independent web browser

301 B
Raw Blame
<!DOCTYPE html>
<style>
    ::selection { color: black; background: lime; }
    span { display: inline-block; }
</style>
<p id="start"><span>outside of the selection</span></p>
<p id="end">selected text</p>
<script>
    getSelection().setBaseAndExtent(end.firstChild, 0, end.firstChild, 8);
</script>