blob: dbcfd70903126ed89f91523aea4d0ad06001b3ff [file]
<html>
<body>
<div id='ce' contenteditable autofocus>
Line one<br>
<a id='link' href='#'>Link text</a> node
</div>
<script>
// Set selection in the contenteditable via JS.
const link = document.getElementById('link');
const range = document.createRange();
range.selectNodeContents(link);
const selection = window.getSelection();
selection.removeAllRanges();
selection.addRange(range);
</script>
</body>
</html>