Does chrome supports document.selection?
Use window.getSelection()
, which is the most cross-browser compatible (it's supported in the current versions of all major browsers) and is the standard. Chrome certainly supports it as fully as other browsers.
document.selection
should only be used for IE < 9.
Try document.getSelection()
or window.getSelection()
.
Here's a quick example that I tested in chrome
http://jsfiddle.net/hgDwx/