javascript - Create Onsen UI elements dynamically -


is possible create onsen ui elements dynamically using javascript? official documentation says nothing it.

you can create dynamically onsen uui elements using ons._util.createelement() function. takes, in input, html code want generate. example:

var button = ons._util.createelement("<ons-button></ons-button>"); document.body.appendchild(button); 

it create ons-button element, , append body.

edit

you can create in alternative way:

var div = document.createelement('div'); div.innerhtml = '<ons-button></ons-button>' document.body.appendchild(div); 

Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -