1 下载 CKEditor http://ckeditor.com/demo

CKEditor 实例

3 index.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
<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
    <script src="js/ckeditor.js"></script>
</head>
<body>
 
    <textarea id="editor"></textarea>
 
    <script>
        CKEDITOR.replace( 'editor',{
            width: 800,
            height: 200,
            resize_dir: 'both',
            resize_minWidth: 800,
            resize_minHeight: 200,
            resize_maxWidth: 800,
            resize_maxHeight: 200,
            toolbar :[{name:"image",items:["Image"]},{name:"table",items:["Table"]}] // 设置toolbar
        });
        // 获取内容
        // CKEDITOR.instances["editor"].getData();
        // 获取选中内容
        // CKEDITOR.instances["editor"].getSelectedHtml()
    </script>
</body>
</html>

   

相关文章:

  • 2021-06-29
  • 2021-04-23
猜你喜欢
  • 2021-06-06
  • 2022-12-23
  • 2022-02-13
  • 2022-12-23
  • 2021-08-17
  • 2021-11-23
  • 2021-08-01
相关资源
相似解决方案