I want to get the text currently selected in a document being edited in Google Docs. The following does not do the job (though it works fine in every other context where I have tried it):
var thisText=window.getSelection ? window.getSelection() : document.getSelection ? document.getSelection() : document.selection ? document.selection.createRange().text : null;
What am I missing?
Thanks,
JAS
var thisText=window.getSelection ? window.getSelection() : document.getSelection ? document.getSelection() : document.selection ? document.selection.createRange().text : null;
What am I missing?
Thanks,
JAS