I already asked this question before when stack overflowed, but received no answer. I have 2 links called add emoji 1 and add emoji 2. That was my question. Paste emoticon at cursor position
Now, even when I made certain changes, and here the problem is that emoticons are inserted only at the end of the div, and not at the cursor position. My new demo: 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"/>' ); });
I want the emoticon to be inserted into the corresponding contenteditable div, wherever the cursor is. Thanks in advance.
Note: I had a contenteditable div where I want to add image and not in the textarea.
source share