How to display the cursor at the end of the text after inserting content into RTE?
We can display the cursor at the end of the text after inserting content to the RTE by using the “focus()” method as shown below code:
JavaScript:
<script type="text/javascript" class="jsScript">
var content = "Hello this is a sample";
document.getElementById("button1").onclick = function () {
var rteObj = $("#rteSample").data("ejRTE");
rteObj.focus();
rteObj.executeCommand("inserthtml", content);
return false;
};
</script>
This will display the cursor next to the content automatically when inserted. Please find the sample from the following link:
Sample Link: http://jsplayground.syncfusion.com/32fcyqcy