Form extends Element

The API model used to edit the form.

Methods

append(html)

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

var form = editor.getAPIModelById('id');
form.append('<span>TEXT</span>');

prepend(html)

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

var form = editor.getAPIModelById('id');
form.prepend('<span>TEXT</span>');

remove()

Removes the Element itself.

var form = editor.getAPIModelById('id');
form.remove();

replace(html)

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

var form = editor.getAPIModelById('id');
form.replace('<p><span>Form replaced</span></p>');

setHTML(html)

Set the HTML string value passed as an argument to the form's internal HTML.

var form = editor.getAPIModelById('id');
form.setHTML('<p><span>Add HTML. 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 form.

var form = editor.getAPIModelById('id');
form.setText('Sample text.');