Get selected text

👋 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