Dalen Dalen - 3 months ago 24
Javascript Question

Programatically retrieve content from WYSIHTML5 editor

How do I programatically retrieve content from a

WYSIHTML5
editor?
Suppose the editor is instantiated as this:

var editor = new wysihtml5.Editor
(
$(this.el).find('textarea').get(0),
{
toolbar: "toolbar",
parserRules: wysihtml5ParserRules
}
);


i would like to get the editor's content on
blur
event

editor.on
(
"blur",
function()
{
//what here?
}
);


Thank you

Ped Ped
Answer

It's much better to use the API editor.getValue()

(@dalen mentioned this in the comment above)