The following JavaScript code can change user's selection range in UIWevView but iOS selection remains unchanged. How can I synchronize both selections, so when the app changes selection using JavaScript, iOS selection changes as well. Is it possible?
var sel = window.getSelection();
var range = document.createRange();
range.setStart(sel.anchorNode,sel.anchorOffset + 1); // it removes the first letter from a selected range
range.setEnd(sel.focusNode,sel.focusOffset);
sel.removeAllRanges();
sel.addRange(range);