-
Notifications
You must be signed in to change notification settings - Fork 213
/
quill.html
56 lines (55 loc) · 1.32 KB
/
quill.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>quill富文本编辑器</title>
<style>
.btn{
border:1px solid #eee;
padding: 15px;
margin-top: 20px;
cursor: pointer;
background: #00aac5;
color: #fff;
}
.content{
margin-top: 20px;
padding:12px;
border:1px solid #eee;
background: #000;
color: #fff;
display: none;
}
</style>
<script src="https://cdn.quilljs.com/1.3.3/quill.js"></script>
<link href="https://cdn.quilljs.com/1.3.3/quill.snow.css" rel="stylesheet">
<script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js" type="text/javascript"></script>
</head>
<body>
<!-- 编辑器 -->
<div id="editor">
<p>Hello World!</p>
<p>Some initial <strong>bold</strong> text</p>
<p><br></p>
</div>
<!-- 按钮 -->
<div style="padding: 15px;margin-top: 20px;">
<span onclick="nihao();" class="btn">获取编辑器内容</span>
</div>
<!-- 获取内容 -->
<div class="content">
</div>
<script>
var quill = new Quill('#editor', {
theme: 'snow'
});
function nihao() {
let t = quill.container.firstChild.innerHTML
console.log(t)
$('.content').css('display', 'block')
$('.content').text(t)
}
</script>
</body>
</html>