如何检索羽毛笔文本编辑器的内容 [英] How do I retrieve the contents of a Quill text editor

查看:57
本文介绍了如何检索羽毛笔文本编辑器的内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在javascript应用中使用羽毛笔文本编辑器,我需要以包含HTML的字符串的形式检索文本编辑器的内容,但是文档对此主题有点稀疏.

I am using the quill text editor in a javascript app and I need to retrieve the contents of the text editor as a string with the HTML included but the docs are a little sparse on this subject.

推荐答案

只需访问编辑器的innerHTML,就可以了:

Quite simply by accessing the editor's innerHTML:

var quill = new Quill('#editor', {
    theme: 'snow'
});
// ....
var editor_content = quill.container.innerHTML // or quill.container.firstChild.innerHTML could also work

希望这会有所帮助!

这篇关于如何检索羽毛笔文本编辑器的内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆