Body extends Element

The API model used to edit the Body area. In Synap Editor, the body area is composed of <div class='se-contents'></div>.

Methods

append(html)

The HTML String passed as an argument is added as a child at the back of the Element.

var body = editor.getAPIModels('.se-contents')[0];
body.append('<p><span>APPEND TEXT</span></p>');

prepend(html)

The HTML String passed as an argument is added as a child to the front of the Element.

var body = editor.getAPIModels('.se-contents')[0];
body.prepend('<p><span>PREPEND TEXT</span></p>');

replace(html)

Replaces the element itself with the HTML String passed as an argument.

var body = editor.getAPIModels('.se-contents')[0];
body.replace('<p><span>Body replaced</span></p>');

setHTML(html)

Sets the HTML string value passed as an argument to the body's internal HTML.

var body = editor.getAPIModels('.se-contents')[0];
body.setHTML('<p><span>Add HTML to the body. All previously entered information will be erased.</span></p>');

setText(text)

Set the text string value passed as an argument to the internal text of the body.

var body = editor.getAPIModels('.se-contents')[0];
body.setText('Add text to the body. All previously entered information will be erased.');