My query was already posted on stack overflow but unfortunately, I did not receive a response. The issue revolves around 2 links named "add emoji 1" and "add emoji 2". As mentioned earlier, my question can be accessed here: Insert smiley at cursor position
Despite implementing some changes, the problem persists as emojis are only added at the end of the div rather than at the cursor's position. For reference, you can check out my latest demo here: https://jsfiddle.net/ftwbx88p/8/
$( document ).on( "click" , "#button" , function() {
$( ".editable.focus" ).append( '<img src="https://cdn.okccdn.com/media/img/emojis/apple/1F60C.png"/>' );
});
It is crucial that the emojis are inserted into the respective contenteditable div wherever the cursor is placed. Any assistance is greatly appreciated.
Note: In my scenario, it is essential that the image is incorporated within the contenteditable div rather than the textarea.