我想访问用 summer-note
编辑器编写的文本,以将其保存到数据库中。
我正在为我的博客网站使用 summer note,但我无法访问类名为 note-editable
的 div 的数据..
这是我要访问的 div 的代码:
<div class="note-editable" contenteditable="true" style="height: 510px;">
hi...Write an amazing Post....
</div>
任何人都知道如何实现它..在此先感谢....
最佳答案
只需看看开发人员为此任务设置了什么:(来自 summernote.org):
get & set Code
Get the HTML contents of the first summernote in the set of matched elements.
var sHTML = $('.summernote').code();
Get the HTML content of the second summernote with jQuery eq.
var sHTML = $('.summernote').eq(1).code();
A string of HTML to set as the content of each matched element.
$('.summernote').code(sHTML);
for more detail api: deep dive with api
这段代码有什么问题?你可以获得什么?
关于javascript - 使用 summer-note 编辑器 div 的类 'note-editable ' 访问 div 的数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31378620/