当前位置:主页 > 网页前端 > JavaScript代码 >

layui 富文本赋值,取值,取纯文本值的实例

时间:2020-10-14 14:59:34 | 栏目:JavaScript代码 | 点击:

layui 富文本赋值:

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
<title>layui</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="/Public/lib/layui/css/layui.css" rel="external nofollow" media="all">
</head>
<body>
<textarea id="demo" style="display: none;"></textarea>
 
 
<script src="/Public/lib/jquery.min.js"></script>
<script src="/Public/lib/layui/layui.js"></script>
<script>
layui.use(['layedit'], function(){
 var layedit=layui.layedit;
 var index=layedit.build('demo'); //建立编辑器
 layedit.setContent(index,"你好");
});
 
</script>
</body>
</html>

layui 富文本取值:

layedit.getContent(editIndex);//取整个值
layedit.getText(editIndex);//取纯文本值

您可能感兴趣的文章:

相关文章