The Selection API allows me to get the current selection with window.getSelection() and edit the selection with
window.getSelection()
selection.modify('extend', 'backward', 'character');
to, for example, go back a character.
But how can I actually select text with the selection API?
1.4m articles
1.4m replys
5 comments
57.0k users