第一步:在前台html文件中引入js:
<script src="__ROOT__/Public/js/kindeditor/kindeditor.js"></script>
第二步:在前台html文件中写入:
<textarea id='content1' type="content1" name="title" style="width:700px;height:350px;"></textarea>
第三步:在js文件中写入:
KindEditor.ready(function(K) {
editor1 = K.create('textarea[type="content1"]', { //注意:content1为<textarea>中的type
afterBlur:function(){this.sync();}, //将编辑器的内容设置到原来的textarea控件里 ,获取编辑器的内容
});
editor1.exec('fontsize', '16px'); //控制编辑器中文字的大小
});
注意:editor1.text("");为清空编辑器的内容
<script src="__ROOT__/Public/js/kindeditor/kindeditor.js"></script>
第二步:在前台html文件中写入:
<textarea id='content1' type="content1" name="title" style="width:700px;height:350px;"></textarea>
第三步:在js文件中写入:
KindEditor.ready(function(K) {
editor1 = K.create('textarea[type="content1"]', { //注意:content1为<textarea>中的type
afterBlur:function(){this.sync();}, //将编辑器的内容设置到原来的textarea控件里 ,获取编辑器的内容
});
editor1.exec('fontsize', '16px'); //控制编辑器中文字的大小
});
注意:editor1.text("");为清空编辑器的内容