Skip to content

Commit

Permalink
Update selection.html
Browse files Browse the repository at this point in the history
  • Loading branch information
muan committed Sep 26, 2023
1 parent 6c65327 commit 6c0afa1
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions selection.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,8 @@ <h1>Sequential focus navigation start point</h1>
setselection.addEventListener('click', e => {
const range = new Range()
const node = document.querySelector('div')
console.log(node)
range.setStart(node, 0)
range.setEnd(node, 1)
window.getSelection().removeAllRanges()
window.getSelection().addRange(range)
window.getSelection().collapse(node, 0)
})
</script>
</body>
</html>
</html>

0 comments on commit 6c0afa1

Please sign in to comment.