如何将输入类型文本添加到 CKEditor

How to add an input type text to CKEditor

我正在尝试使用 CKEditor 制作简单的网络编辑器,但我无法找到如何使其与输入类型文本一起使用,它在文本区域中运行良好。

首先我查看了他们的样品网站。他们使 CKEditor 工作的唯一方法是包含 .js 文件并添加 ckeditor class 以形成输入类型文本元素。

<script src="../ckeditor.js"></script>
.
.
.
<input type="text" class="ckeditor" name="editor1" >

如何在 input type = text 中添加 ckeditor?

正在使用

CKEDITOR.replace( 'editor1' );

和HTML喜欢

<input type="text" class="ckeditor" name="editor1">

应该可以正常工作,检查 this codepen。也许检查浏览器控制台中的错误或者 ckeditor.js 文件是否正确加载?