Return to Snippet

Revision: 46835
at May 26, 2011 08:19 by wbednarski


Initial Code
function getSelText() {
		
	var s = '';
		
	if (window.getSelection) {
		s = window.getSelection();
	}
	else if (document.getSelection) {
		s = document.getSelection();
	}
	else if (document.selection) {
		s = document.selection.createRange().text;
	}
	
	return s;
}

Initial URL


Initial Description


Initial Title
Get selected text

Initial Tags
javascript

Initial Language
JavaScript