| 1 | <!DOCTYPE html> |
|---|
| 2 | <html> |
|---|
| 3 | <head> |
|---|
| 4 | <meta charset="utf-8"> |
|---|
| 5 | <title>A Simple Page with CKEditor</title> |
|---|
| 6 | <script src="https://code.jquery.com/jquery-2.1.4.min.js"></script> |
|---|
| 7 | <script src="../ckeditor.js"></script> |
|---|
| 8 | </head> |
|---|
| 9 | <body> |
|---|
| 10 | <button id="myFirstButton">Click Me</button> |
|---|
| 11 | <button id="mySecondButton">And Then Click Me</button> |
|---|
| 12 | <form> |
|---|
| 13 | <textarea name="editor1" id="editor1" rows="10" cols="80"></textarea> |
|---|
| 14 | <script> |
|---|
| 15 | var editor = CKEDITOR.replace( 'editor1', {extraPlugins:'divarea'} ); |
|---|
| 16 | |
|---|
| 17 | $('#myFirstButton').on('click', function(){ |
|---|
| 18 | editor.insertHtml( '<img src="http://c.cksource.com/a/5/img/sprites.png" />' ); |
|---|
| 19 | }); |
|---|
| 20 | $('#mySecondButton').on('click', function(){ |
|---|
| 21 | alert( editor.getData() ); |
|---|
| 22 | }); |
|---|
| 23 | </script> |
|---|
| 24 | <button type="submit">Submit</button> |
|---|
| 25 | </form> |
|---|
| 26 | </body> |
|---|
| 27 | </html> |
|---|