<!DOCTYPE html> <!-- Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or http://ckeditor.com/license --> <html> <head> <meta charset="utf-8"> <title>CKEditor Sample</title> <script type="text/javascript" src="http://qiniu.9hlh.com/jscss$jquery.min.js"></script> <script src="../ckeditor.js"></script> </head> <body > <div id="editor"> </div> <div id="editor2"> </div> <button id="one">获取1</button> <button id="two">获取1</button> <script> //initSample(); //CKEDITOR.config.height = 150; //CKEDITOR.config.width = 'auto'; //var editorElement = CKEDITOR.document.getById( 'editor' ); CKEDITOR.replace( 'editor' ); CKEDITOR.replace( 'editor2' ); $("#one").click(function () { var stem = CKEDITOR.instances.editor.getData(); alert(""+stem); }) $("#two").click(function () { var stem = CKEDITOR.instances.editor2.getData(); alert(""+stem); }) </script> </body> </html>