javascript get tags from selected text code example Example: get selected text js // Get highlighted text this way: window.getSelection().toString()