# Generate elements dynamically

Example #1 Trigger Create
Trigger Create after append element on HTML.

$( "#checkboxItems" ).append( newhtml).trigger( "create" );

Add new item
Example #2 Call the widget Creator function.
Call the widget's creator function after append element on HTML.
Usually, creator function is same to widget name. But, "button" widget is a little bit different. Call buttonMarkup() or trigger "create" to the parent of button.

/* Append new button */
var buttonTemplate = "<div data-role='button' data-inline='true' " + "data-icon='call' data-style='circle' " + "data-theme='s' class='newbutton'></div>";
$( buttonTemplate ).buttonMarkup().appendTo( "#buttonItems" );
/* It's same to call ".buttonMarkup()". */
$( "#buttonItems" ).trigger( "create" );

Add new Button item
Example #3 Append Listview on JQM.
To add new <LI> element on JQM listview, insert items and call "refresh" to the listview.

var listTemplate = "<li>Appended New Item</li>";
$( "#listview" ).append( listTemplate ).listview( "refresh");

- Test
- Test
- Test

Add new item to Listview