Get selected text 4 Aug 2020 1 min read Edit on GitHub javascript document.onselectionchange = () => { const text = document.getSelection().toString() console.log(text) }