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

ListItem extends Element

It is the item (LI) model that composes the list of bullets (OL) and bullets (UL).

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 listItem = editor.getAPIModelById('id');
listItem.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 listItem = editor.getAPIModelById('id');
listItem.prepend('<span>TEXT</span>');

setHTML(html)

  • html <String>HTML string to set inside ListItem

Sets the HTML string value passed as an argument to the internal HTML of the ListItem.

var listItem = editor.getAPIModelById('id');
listItem.setHTML('<p><span>Add HTML. All previously entered information will be erased.</span></p>');

setText(text)

  • text <String> Text string to set inside ListItem

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

var listItem = editor.getAPIModelById('id');
listItem.setText('Sample text.');
  • No labels