| 1 | <!DOCTYPE html> |
|---|
| 2 | <!-- |
|---|
| 3 | Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. |
|---|
| 4 | For licensing, see LICENSE.html or http://ckeditor.com/license |
|---|
| 5 | --> |
|---|
| 6 | <html> |
|---|
| 7 | <head> |
|---|
| 8 | <title>Replace Textarea by Code — CKEditor Sample</title> |
|---|
| 9 | <meta charset="utf-8"> |
|---|
| 10 | <script src="../ckeditor_source.js"></script> |
|---|
| 11 | <link href="sample.css" rel="stylesheet" /> |
|---|
| 12 | |
|---|
| 13 | </head> |
|---|
| 14 | <body> |
|---|
| 15 | <h1 class="samples"> |
|---|
| 16 | <a href="index.html">CKEditor Samples</a> » Replace Textarea Elements Using JavaScript Code |
|---|
| 17 | </h1> |
|---|
| 18 | <form action="sample_posteddata.php" method="post"> |
|---|
| 19 | <div class="description"> |
|---|
| 20 | <p> |
|---|
| 21 | This editor is using an <code><iframe></code> element-based editing area, provided by the <strong>Wysiwygarea</strong> plugin. |
|---|
| 22 | </p> |
|---|
| 23 | <pre class="samples"> |
|---|
| 24 | |
|---|
| 25 | CKEDITOR.replace( '<em>textarea_id</em>' ) |
|---|
| 26 | </pre> |
|---|
| 27 | </div> |
|---|
| 28 | |
|---|
| 29 | <div id="wrapper" style="display:none;"> |
|---|
| 30 | <textarea cols="80" rows="10" id="editor1">A</textarea> |
|---|
| 31 | </div> |
|---|
| 32 | |
|---|
| 33 | <p> |
|---|
| 34 | <input type="button" value="ClickMe" id="bttn" onclick="toggle();"> |
|---|
| 35 | </p> |
|---|
| 36 | <script> |
|---|
| 37 | CKEDITOR.replace('editor1'); |
|---|
| 38 | |
|---|
| 39 | function toggle(){ |
|---|
| 40 | var element = document.getElementById('wrapper'); |
|---|
| 41 | if(element.style.display) |
|---|
| 42 | element.style.display=''; |
|---|
| 43 | else |
|---|
| 44 | element.style.display='none'; |
|---|
| 45 | } |
|---|
| 46 | </script> |
|---|
| 47 | </form> |
|---|
| 48 | <div id="footer"> |
|---|
| 49 | <hr> |
|---|
| 50 | <p> |
|---|
| 51 | CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a> |
|---|
| 52 | </p> |
|---|
| 53 | <p id="copy"> |
|---|
| 54 | Copyright © 2003-2013, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico |
|---|
| 55 | Knabben. All rights reserved. |
|---|
| 56 | </p> |
|---|
| 57 | </div> |
|---|
| 58 | </body> |
|---|
| 59 | </html> |
|---|