I am creating a set of checkboxes dynamically using Dojo 1.8. After creating the checkbox, I'm also setting the label for the checkbox, but the label is not visible on the site, although I can see it when I look at the HTML in Firebug. Any ideas what I am doing wrong? I've looked at the code too much at this point and can't figure out what it is. Thank you!
var checkboxContainer = dom.byId('divLayers');
var chkboxId = 'chk' + layer.id;
var chkbox = new dijit.form.CheckBox({
id: chkboxId,
checked: layer.visible,
onClick: lang.hitch(this, this.toggleLayerVisibility)
});
chkbox.placeAt(checkboxContainer);
chkbox.domNode.appendChild(domConstruct.create('label', { 'for': chkboxId, innerHTML: layer.name }));