Demo is here
I have a contenteditable div. I want the functionality in the div as follows:
When I click on red anchor tag, the new text that I will write will be
Try this one. It works perfectly for me
$("#red").click(function () {
$('#my-contenteditable-div').html($('#my-contenteditable-div').html() + ' ');
});
$("#blue").click(function () {
$('#my-contenteditable-div').html($('#my-contenteditable-div').html() + ' ');
});
Demo Here : https://jsfiddle.net/Saneesharoor/ftwbx88p/