mirror of
https://github.com/201206030/novel-plus.git
synced 2025-06-24 04:46:37 +00:00
文件夹结构调整,新增模版自定义功能
This commit is contained in:
@ -0,0 +1,33 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>wangEditor demo textarea</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>编辑器</p>
|
||||
<div id="div1">
|
||||
<p>欢迎使用 <b>wangEditor</b> 富文本编辑器</p>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<p>textarea</p>
|
||||
<textarea id="text1" style="width:100%; height:200px;"></textarea>
|
||||
|
||||
<script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="../wangEditor.js"></script>
|
||||
<script type="text/javascript">
|
||||
var E = window.wangEditor
|
||||
var editor = new E('#div1')
|
||||
var $text1 = $('#text1')
|
||||
editor.customConfig.onchange = function (html) {
|
||||
// 监控变化,同步更新到 textarea
|
||||
$text1.val(html)
|
||||
}
|
||||
editor.create()
|
||||
// 初始化 textarea 的值
|
||||
$text1.val(editor.txt.html())
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Reference in New Issue
Block a user