<script type="text/javascript"> <!-- function a() { var b = window.getSelection().toString(); alert(b); } // --> </script>