SubEditor can be used on textarea, or inject into div.
<form> <textarea id="editorTextarea" style="width:500px;height:300px"></textarea> </form>
var _subeditor = new SubEditor(document.querySelector('#editorTextarea'), { onChange : function(changeValue) { console.log(changeValue.key,changeValue.change, changeValue.content); ); }, pluginList : ["fullscreen","hr", "color","source","align","text","undo","redo","indent","format","remove_format","link", "paste","list", "table","image"], toolbarList : ["undo","redo","text","format","link","remove_format","indent","outdent","color","backgroundcolor","align","ol","ul","image","table","hr","source","fullscreen"], }); };
<div id="editorDiv"> </div>
var _subeditor = new SubEditor(document.querySelector('#editorDiv'), { width : 450, height: 250, value : '', autoGrow : true, onChange : function(changeValue) { console.log(changeValue.key,changeValue.change, changeValue.content); ); }, pluginList : ["fullscreen","hr", "color","source","align","text","undo","redo","indent","format","remove_format","link", "paste","list", "table","image"], toolbarList : ["undo","redo","text","format","link","remove_format","indent","outdent","color","backgroundcolor","align","ol","ul","image","table","hr","source","fullscreen"], }); };
_subeditor.value();
In the case of textarea, the value of textarea will automatically be sync as you type.