Created
April 9, 2012 11:54
-
-
Save gregdangelo/2343026 to your computer and use it in GitHub Desktop.
Support: IE6, Fx2, Opera9, Safari Cross browser getSelection().
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 getSelection() { | |
return (!!document.getSelection) ? document.getSelection() : | |
(!!window.getSelection) ? window.getSelection() : | |
document.selection.createRange().text; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment