I am new to javascript, trying to perform:
document.selection.createRange();
but document.selection always returns undefined.
document.selection
undefined
I am using latest version of chrome.
what am I doing wrong?
thanks!
Try document.getSelection() or window.getSelection().
document.getSelection()
window.getSelection()
Here's a quick example that I tested in chrome
http://jsfiddle.net/hgDwx/