方法一:
<script type='text/javascript' src='ckeditor/ckeditor.js'></script>
<textarea name='content' class='ckeditor'>
方法二:
<script type='text/javascript' src='ckeditor/ckeditor.js'></script>
<textarea name='content' cols=30 rows=5 id='editor'>請輸入內容</textarea>
<script type='text/javascript'>
CKEDITOR.replace('editor' , { skin : 'v2' , toolbar : 'Basic' } );
</script>
自行定義工具列:http://docs.cksource.com/CKEditor_3.x/Developers_Guide/Toolbar
例如(config,js):
CKEDITOR.editorConfig = function( config )
{
config.toolbar = 'MyToolbar';
config.toolbar_MyToolbar =
[
{ name: 'clipboard', items : [ 'Undo','Redo' ] },
{ name: 'insert', items : [ 'Image','Flash','Table','HorizontalRule','Smiley','PageBreak' ] },
{ name: 'basicstyles', items : [ 'Bold','Italic','Strike','RemoveFormat' ] },
{ name: 'paragraph', items : [ 'NumberedList','BulletedList','Outdent','Indent'] },
{ name: 'links', items : [ 'Link','Unlink' ] },
{ name: 'styles', items : [ 'Styles','Format' ] },
{ name: 'tools', items : [ 'Font','FontSize' ] }
];
};