I also did not realize you were referring to the Dojo checkbox dijit rather than a regular HTML checkbox. The sample below shows how each type of checkbox can be programmatically checked.
I agree with @Tyrone Biggums in that I would just use a regular HTML checkbox rather than the Dojo checkbox, as the Dojo checkbox just adds an extra layer of complexity.
<input type="checkbox" id="dojoCheckbox" checked="checked" />
<input type="checkbox" id="normalCheckbox" checked="checked" />
<button type="button" id="theButton">
Toggle the checkboxes
</button>
require(["dijit/form/CheckBox", "dijit/registry"], function(CheckBox, registry) {
// Create the Dojo checkbox
var cb = new CheckBox({
checked: true
}, "dojoCheckbox");
// Get a reference to the button.
var b = document.getElementById("theButton");
// set the button click event
b.onclick = function() {
// Use the registry to get the checkbox dijit.
cb = registry.byId("dojoCheckbox");
// Set the dojo checkboxes "checked" property to be
// opposite what it currently is.
cb.set("checked", !cb.checked);
// Get the regular checkbox and check it.
var ncb = document.getElementById("normalCheckbox");
ncb.checked = !ncb.checked;
};
});