0

Possible Duplicate:
getSelection() not working in IE

I was trying to get the selected content, and I found this:

   window.getSelection().toString();

It works in most of the browser, except the obvious, IE.

So, what to do?

Community
  • 1
  • 1
user1691388
  • 138
  • 1
  • 7
  • 1
    http://stackoverflow.com/questions/5421892/getselection-not-working-in-ie Is this what you're looking for? – George Oct 01 '12 at 12:56

2 Answers2

0

Only IE9 onwards supports window.getSelection(). You can use document.selection instead in earlier versions.

Mitch Satchwell
  • 4,770
  • 2
  • 24
  • 31
0

The full syntax was:

document.selection.createRange().text;
Vikdor
  • 23,934
  • 10
  • 61
  • 84
user1691388
  • 138
  • 1
  • 7