The reason it is difficult to find a plugin for this is not because it is not a very "jQuery" ish. By this I mean that jQuery plugins usually work with jQuery objects, and the selection has nothing to do with any elements.
Edit: I missed the fact that you posted this link in your question, but I will leave it below for completeness, as my version is formatted better (but otherwise identical). :)
<script language=javascript> 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; document.aform.selectedtext.value = txt; } </script> <input type="button" value="Get selection" onmousedown="getSelText()"> <form name=aform > <textarea name="selectedtext" rows="5" cols="20"></textarea> </form>
cletus
source share