javascript - Convert CKEDITOR to TextArea -
i have text area , button. on click of button i'm converting textarea ckeditor. additional requirement , on click of other button ckeditor must converted textarea. code:
<textarea name="editor"></textarea> <input type="button" value="click" onclick="createeditor('editor')" /> <script type="text/javascript"> function createeditor(name) { var editor = ckeditor.instances[name]; if (editor) { editor.destroy(true); } ckeditor.replace(name, { toolbarstartupexpanded: false, autogrow_onstartup: true }); if (ckeditor.env.webkit) { ckeditor.on("instanceready", function (e) { document.getelementsbyclassname("cke_wysiwyg_frame cke_reset")[0].contentdocument.body.parentnode.contenteditable = "true"; if (typeof focusedelement !== 'undefined') { focusedelement = e.editor.name; } }); } } </script>
how can achieve this?
in case of more common use case - requirement html code ckeditor (not text), use editor.getdata(). see documentation more details.
Comments
Post a Comment