1 下载 CKEditor http://ckeditor.com/demo
3 index.html
<!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:"p_w_picpath",items:["Image"]},{name:"table",items:["Table"]}] // 设置toolbar
});
// 获取内容
// CKEDITOR.instances["editor"].getData();
// 获取选中内容
// CKEDITOR.instances["editor"].getSelectedHtml()
</script>
</body>
</html>
转载于:https://blog.51cto.com/antlove/1727901