9951 explained code solutions for 126 technologies
window.getSelection().toString();ctrl + cyoutubegithub
window.getSelection().toString();
window.getSelection()
returns current Selection object
.toString()
will return string with currently selected text (or empty string)