Posted By

kif on 08/11/06


Tagged

select text


Versions (?)

Who likes this?

5 people have marked this snippet as a favorite

tylerhall
luman
vali29
chunkytext
jimmayes


getSelection


 / Published in: JavaScript
 

Support: IE6, Fx2, Opera9, Safari Cross browser getSelection().

  1. function getSelection() {
  2. return (!!document.getSelection) ? document.getSelection() :
  3. (!!window.getSelection) ? window.getSelection() :
  4. document.selection.createRange().text;
  5. }

Report this snippet  

You need to login to post a comment.