get selected text js
snippet in javascript

get selected text js

user9712

// Get highlighted text this way:

window.getSelection().toString()