Get selected text
04 Aug, 2020
👋 FYI, this note is over 6 months old. Some of the content may be out of date.
document.onselectionchange = () => {
const text = document.getSelection().toString()
console.log(text)
}
← Back home