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
Post a Comment