3 Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
\r
4 For licensing, see LICENSE.md or http://ckeditor.com/license
\r
8 <meta charset="utf-8">
\r
9 <title>Append To Page Element Using JavaScript Code — CKEditor Sample</title>
\r
10 <script src="../ckeditor.js"></script>
\r
11 <link rel="stylesheet" href="sample.css">
\r
14 <h1 class="samples">
\r
15 <a href="index.html">CKEditor Samples</a> » Append To Page Element Using JavaScript Code
\r
18 <div class="description">
\r
20 The <code><a class="samples" href="http://docs.ckeditor.com/#!/api/CKEDITOR-method-appendTo">CKEDITOR.appendTo()</a></code> method serves to to place editors inside existing DOM elements. Unlike <code><a class="samples" href="http://docs.ckeditor.com/#!/api/CKEDITOR-method-replace">CKEDITOR.replace()</a></code>,
\r
21 a target container to be replaced is no longer necessary. A new editor
\r
22 instance is inserted directly wherever it is desired.
\r
24 <pre class="samples">CKEDITOR.appendTo( '<em>container_id</em>',
\r
25 { /* Configuration options to be used. */ }
\r
26 'Editor content to be used.'
\r
31 // This call can be placed at any point after the
\r
32 // DOM element to append CKEditor to or inside the <head><script>
\r
33 // in a window.onload event handler.
\r
35 // Append a CKEditor instance using the default configuration and the
\r
36 // provided content to the <div> element of ID "section1".
\r
37 CKEDITOR.appendTo( 'section1',
\r
39 '<p>This is some <strong>sample text</strong>. You are using <a href="http://ckeditor.com/">CKEditor</a>.</p>'
\r
48 CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a>
\r
51 Copyright © 2003-2014, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico
\r
52 Knabben. All rights reserved.
\r