how to find the highlighted area in js code example Example: get selected text js // Get highlighted text this way: window.getSelection().toString()