Posted By

rolfthomas on 07/04/08


Tagged

javascript js textmate browser selection


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

SpinZ
wizard04


cross-browser way to get selection


 / Published in: Other
 

  1. function getSel(){
  2. var w=window,d=document,gS='getSelection';
  3. return (''+(w[gS]?w[gS]():d[gS]?d[gS]():d.selection.createRange().text)).replace(/(^\s+|\s+$)/g,'');
  4. }

Report this snippet  

You need to login to post a comment.