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('');