I\'m executing these simple rows of javascript in latest ie 11, just to select all content of a div
Here a screenshot from ie11 dev tool
I got this error when trying to window.getSelection().removeAllRanges();
and there was no selection. One workaround is to check if there is a selection first:
if (window.getSelection().getRangeAt(0).getClientRects.length > 0) {
window.getSelection().removeAllRanges();
}
Also, this question is a duplicate of Could not complete the operation due to error 800a025e, but I couldn't mark it as such because the other question doesn't have an accepted answers.