zui框架kindeditor编辑器赋值与取值

1 引入js

<script src="../../Js/zui/lib/kindeditor/kindeditor-min.js"></script>

2 html

  <textarea rows="5" name='description' id='description'
     value='' class='form-control kindeditorSimple'></textarea>

3 js方法

//页面初始化
var  editor = KindEditor.create('textarea.kindeditorSimple', {
        basePath: '../../Js/zui/lib/kindeditor/',
        bodyClass : 'article-content',     // 确保编辑器内的内容也应用 ZUI 排版样式
        cssPath: '../../Js/zui/css/zui.css', // 确保编辑器内的内容也应用 ZUI 排版样式
        resizeType : 1,
        allowPreviewEmoticons : false,
        allowImageUpload : false,
        items : [
            'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',
            'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
            'insertunorderedlist', '|', 'emoticons','image', 'link'
        ]
    });


//取值
 var description = editor.html();
//赋值
editor.html(description );
发布了51 篇原创文章 · 获赞 18 · 访问量 2万+

猜你喜欢

转载自blog.csdn.net/m0_37882063/article/details/103661993