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

本文介绍如何在网页中集成KindEditor富文本编辑器,包括JS、HTML和JS方法的详细步骤,实现编辑器的基本配置如字体大小、颜色选择等功能。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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 );
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值