AutoJS
AutoJS copied to clipboard
auto.js for div contenteditable tag
I am using this plugin for div contenteditable=true tag.. everything is working but when user press enter then it selection range doesnot work here is the function:
function SelectChar(el, start, end) { var div = el; var textNode = div.firstChild; if (textNode.data.length > 1) { var rangeObj = document.createRange(); rangeObj.setStart(textNode, start); rangeObj.setEnd(textNode, end);
selection = window.getSelection();
selection.removeAllRanges();
selection.addRange(rangeObj);
} } any idea about that?