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,35 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>wangEditor 设置内容</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>wangEditor 设置内容</p>
|
||||
<div id="div3">
|
||||
<p>欢迎使用 wangEditor 富文本编辑器</p>
|
||||
</div>
|
||||
<div>
|
||||
<button id="btn1">追加内容</button>
|
||||
<button id="btn2">清空内容</button>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript" src="/wangEditor.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
var E = window.wangEditor
|
||||
var editor2 = new E('#div3')
|
||||
editor2.create()
|
||||
|
||||
// 设置内容
|
||||
editor2.txt.html('<p>通过 js 动态设置的内容</p>')
|
||||
|
||||
// 追加内容
|
||||
document.getElementById('btn1').addEventListener('click', function () {
|
||||
editor2.txt.append('<p>追加的内容</p>')
|
||||
}, false)
|
||||
document.getElementById('btn2').addEventListener('click', function () {
|
||||
editor2.txt.clear()
|
||||
}, false)
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Reference in New Issue
Block a user