Closed dinhtuvu closed 7 years ago
You have to manualy initialize the plugin for just created element. Continuing your example:
$('body').delegate('.button-add','click', function(){
var $editable = $('<div class="mentions" contenteditable style="width: 300px; height: 100px; border: 1px solid #000">please typing!</div>');
$editable.appendTo($('body'));
$editable.mentionsInput(...)
});
this is example: https://jsfiddle.net/dinhtuvu/4jd4hrdu/
after click "Click here to add to test for later render" to add new DIV. mention not working with new div