Sunday, 15 February 2015

cordova - how to create two labels side by side using javascript -



cordova - how to create two labels side by side using javascript -

my requirement create 2 labels side side using javascript. used code 1 label, need label right of first label.

my code here var label = document.createelement('label'); label.innerhtml = "hi"; document.body.appendchild(document.createelement("br")); document.body.appendchild(document.createelement("br")); label.addeventlistener("click", onclick); document.body.appendchild(label); want create label right of above one. help me

i think looking for.

var label = document.createelement('label'); var label2 = document.createelement('label'); label.innerhtml = "hi"; label2.innerhtml = "how you?"; document.body.appendchild(document.createelement("br")); document.body.appendchild(document.createelement("br")); document.body.appendchild(label); document.body.appendchild(label2);

update1:

function f1(){ var label = document.createelement('label'); label.innerhtml = "hi"; document.body.appendchild(document.createelement("br")); document.body.appendchild(document.createelement("br")); document.body.appendchild(label); } function f2(){ var label2 = document.createelement('label'); label2.innerhtml = "how you???"; document.body.appendchild(label2); }

update2

function f1(){ var = new array ( "hi", "how you?", "i fine?"); var label = document.createelement('label'); label.innerhtml = a; document.body.appendchild(document.createelement("br")); document.body.appendchild(document.createelement("br")); document.body.appendchild(label); } function f2(){ var label2 = document.createelement('label'); label2.innerhtml = "how you???"; document.body.appendchild(label2); }

javascript cordova

No comments:

Post a Comment