1 下载 CKEditor http://ckeditor.com/demo
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
>
|
本文转自 antlove 51CTO博客,原文链接:http://blog.51cto.com/antlove/1727901