Truly independent web browser
<!DOCTYPE html>
<style>
span {
color: red;
}
</style>
<div contenteditable>lorem ipsum <span>sit dolor amet</span></div>
<script>
const divElm = document.querySelector('div[contenteditable]');
getSelection().setBaseAndExtent(divElm.childNodes[0], 6, divElm.childNodes[1].childNodes[0], 9);
</script>