Hi,
I tried the below piece of code to get the start position of the selected text in Telerik RadEditor control.
var range, text, startpos;
var doc = editor.get_document();
range = editor.getSelectedElement().createTextRange();
text = range.text; var dup = range.duplicate();
range.moveToBookmark(doc.selection.createRange().getBookmark());
dup.setEndPoint('EndToStart', range);
startpos = dup.text.length;
At first time, i get the startposition, if i clear the text again and insert some text and execute the above code, it is throwing error: object doesnt support at the location:range = editor.getSelectedElement().createTextRange();
Please help me to fix the issue.
I tried the below piece of code to get the start position of the selected text in Telerik RadEditor control.
var range, text, startpos;
var doc = editor.get_document();
range = editor.getSelectedElement().createTextRange();
text = range.text; var dup = range.duplicate();
range.moveToBookmark(doc.selection.createRange().getBookmark());
dup.setEndPoint('EndToStart', range);
startpos = dup.text.length;
At first time, i get the startposition, if i clear the text again and insert some text and execute the above code, it is throwing error: object doesnt support at the location:range = editor.getSelectedElement().createTextRange();
Please help me to fix the issue.