Get selected text4 Aug 20201 min read Edit on GitHubjavascriptdocument.onselectionchange = () => { const text = document.getSelection().toString() console.log(text) }