②:引入KindEditor.js;
③:引入KindEditor對應的css;
④:給Html中的文本域賦予壹個id;如:
<textarea id="product"></textarea>
⑤:在js中調用,如:
var editor1;
KindEditor.ready(function(K){
editor1 = K.create("#product",{
width: "80%", //設置文本域的寬度
height: '151px', //設置文本域的高度
//設置文本域的顯示主題風格(需要根據引入的kingEditor主題而定)
themeType : 'simple',
syncType: 'form', //同步表單
resizeType: 0, //禁止用戶拖動文本域
afterBlur: function(){this.sync();} //將kindeditor的值同步到textarea
});
這是基本的,其他屬性可以查看KindEditor的API教程,有詳細介紹