1
I’m using the summernote API as an email editor, it creates a div to be used as a textarea. The only reference it leaves is the "note-Editable" class. I made a code to replace a word with a tag with content-Editable false so that the user tries to delete, delete all text from it. the code I use:
function insertTag(string, tag){
string[0] = string[0] + '<span contentEditable="false" class="enfatizar">' + tag + '</span> ';
var position = string[0].lenght;
code = string[0] + string[1];
$('#inputMsgEmail').code(code);
}
Wanted through the returned lenght to insert the insert bar in div '.note-Editable', something like:
$('.note-editable').caretPosition(position);
That function
code
is from the plugin (summernote)?– bfavaretto