Get selected textAugust 4, 2020javascriptjsCopydocument.onselectionchange = () => { const text = document.getSelection().toString() console.log(text)}Edit this page