ListItem extends Element

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

Methods

append(html)

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)

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)

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)

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