Page tree
Skip to end of metadata
Go to start of metadata

Form extends Element

The API model used to edit the form.

Methods

append(html)

  • html <String> HTML String to append.

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)

  • html <String> HTML String to append.

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.

IF ALL ELEMENTS ARE REMOVED, ERRORS MAY OCCUR IN SUBSEQUENT OPERATIONS.

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

replace(html)

  • html <String> The HTML String to replace.

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)

  • html <String> HTML string to set inside the Form

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)

  • text <String> Text string to set inside Form

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.');
  • No labels