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);//取纯文本值
上一篇:JavaScript面向对象知识串结(读JavaScript高级程序设计(第三版))
栏 目:JavaScript代码
本文地址:http://www.codeinn.net/misctech/11294.html