Get the Highlighted/Selected text

Getting the text the user has selected is relatively simple. There’s no benefit to be gained by involving jQuery since you need nothing other than the window and document objects. function getSelectionText() { var text = “”; if (window.getSelection) { text = window.getSelection().toString(); } else if (document.selection && document.selection.type != “Control”) { text = document.selection.createRange().text; … Read more