AutoJS icon indicating copy to clipboard operation
AutoJS copied to clipboard

auto.js for div contenteditable tag

Open BDhara opened this issue 10 years ago • 0 comments

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?

BDhara avatar Jun 11 '15 11:06 BDhara