ckeditor 使用几点

1.引用相关jsjavascript

2.定义 id 为 editor1 的 areajava

 <textarea id="editor1" style="height: 380px; width: 900px"></textarea>

3.替换spa

 <script type="text/javascript">   
      var editor = CKEDITOR.replace("editor1",
       {
              language: 'vi', height: '370px', width: '900px'
         });
 </script>

4. 赋值和取值code

//取值对应实例名【editor1】的值,getData方法
var content=CKEDITOR.instances.editor1.getData();
//实例名【editor1】赋值为空
CKEDITOR.instances.editor1.setData('');
相关文章
相关标签/搜索