Skip to content

Functions and properties

Oliver Pulges edited this page Sep 4, 2015 · 4 revisions

After initiating the editor object var editor = new wysihtml5.Editor("wysihtml-textarea"); there are various functions available on the obtained editor object.

.cleanUp()

Cleans the content of editor

.config

Returns current editor configuration parameters

.destroy()

Unbinds all event handlers from document, making it safe to delete the editable element from DOM.

.focus()

Sets focus to editable area.

.getValue(parse)

It returns the cleaned HTML content of editor.

var html = editor.getValue();

Attribute parse can be set to false to get the uncleaned content from editor. Default is true.

.isCompatible()

Returns if wysihtml is supported in current browser.

.setValue(html, parse)

Sets editor content to given html string. Attribute parse can be set to false to bypass HTML cleanup on insertion. Default is true.

Clone this wiki locally