I am using below mentioned code for creating checkboxes and labels dynamically. But label and checkboxes are not aligning in same line. Can anyone guide what is wrong in below code?
dojo.require("dijit.form.CheckBox");
dojo.ready(function(){
var widgetNode = dojo.doc.createElement("DIV");
chk = dojo.create("input", {id:"cbox", type:"checkbox"}, widgetNode);
lbl = dojo.create("label", {innerHTML:"Check me", "for":"cbox"}, widgetNode);
dojo.style(lbl, "marginLeft", ".5em");
var cbWidget = new dijit.form.CheckBox({}, chk);
cbWidget.startup();
cbWidget.domNode.appendChild(lbl);
dojo.place(cbWidget.domNode, "container");
});
Aucun commentaire:
Enregistrer un commentaire