<textarea id="container" name="articleContent" class="layui-textarea " lay-verify="content" style="display: none; ">
</textarea>
//初始化编辑器
var articleContent = ' <p><b>1</b></p><p><i>1</i></p><p>1</p>';//通过layui获取文本 ,存储到数据库中,返回显示的html code
$('#container').append(articleContent);//显示text, 如果此话 则显示html code,
var container = layedit.build('container', {
height: 450, //设置编辑器高度
tool: [
'strong' //加粗
, 'italic' //斜体
, 'underline' //下划线
, 'del' //删除线
, '|' //分割线
, 'left' //左对齐
, 'center' //居中对齐
, 'right' //右对齐
, 'link' //超链接
, 'unlink' //清除链接
, 'face' //表情
, 'image' //插入图片
]
});
网友评论