-
Notifications
You must be signed in to change notification settings - Fork 1
/
tiny.html
54 lines (47 loc) · 1.76 KB
/
tiny.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="https://cdn.tiny.cloud/1/no-api-key/tinymce/5/tinymce.min.js" referrerpolicy="origin"></script>
<style>
#mytextarea{
height: 50vh;
}
</style>
<script>
tinymce.init({
selector: '#mytextarea',
plugins: [
'advlist autolink link image lists charmap print preview hr anchor pagebreak spellchecker',
'searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media nonbreaking',
'table emoticons template paste help'
],
toolbar: 'undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | ' +
'bullist numlist outdent indent | link image | print preview media fullpage | ' +
'forecolor backcolor emoticons | help',
menu: {
favs: {title: 'My Favorites', items: 'code visualaid | searchreplace | spellchecker | emoticons'}
},
menubar: 'favs file edit view insert format tools table help',
content_css: 'css/content.css'
});
</script>
</head>
<body>
<h1>TinyMCE Quick Start Guide</h1>
<form method="post">
<textarea id="mytextarea">Hello, World!</textarea>
</form>
<button id="bt">
Get HTML
</button>
<textarea id="myHtml"></textarea>
</body>
<script>
bt.addEventListener('click', (e)=>{
console.log(e)
myHtml.innerHTML = tinyMCE.get('mytextarea').getContent();
})
</script>
</html>