Created
June 29, 2010 17:59
-
-
Save jgv/457558 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getSelText() { | |
var txt = ''; | |
if (window.getSelection) | |
{ | |
txt = window.getSelection(); | |
} | |
else if (document.getSelection) | |
{ | |
txt = document.getSelection(); | |
} | |
else if (document.selection) | |
{ | |
txt = document.selection.createRange().text; | |
} | |
else return; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment