var E = window.wangEditor; var editor = new E('#div1'); editor.customConfig.onchange = function (html) { // html 即变化之后的内容 console.log(html); } editor.create(); editor.txt.html('<p>2</p>');
<div id="div1"> </div>