【问题标题】:How to add an input type text to CKEditor如何将输入类型文本添加到 CKEditor
【发布时间】:2017-12-28 12:28:10
【问题描述】:

我正在尝试使用 CKEditor 制作简单的网络编辑器,但我不知道如何使它与输入类型的文本一起工作,它在 textarea 中运行良好。

首先我检查了他们的示例网站。他们唯一让 CKEditor 工作的就是包含 .js 文件并添加 ckeditor 类来形成输入类型的文本元素。

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

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

【问题讨论】:

    标签: jquery ckeditor


    【解决方案1】:

    使用

    CKEDITOR.replace( 'editor1' );
    

    与 HTML 类似

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

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-05-22
      • 2016-02-22
      • 2017-01-02
      • 2012-12-10
      • 2013-12-21
      • 2019-10-21
      • 2018-12-03
      • 1970-01-01
      相关资源
      最近更新 更多