You can use the dojo.create function. For instance:.
var label = dojo.create("label", {for:"fieldId", innerHTML:"SomeText"}, "tableCellId");
where tableCellId is the identifier of the element to which you want to add a shortcut
Similarly, you can dynamically create a table and add labels to a new table.
var table = dojo.create("table", null, dojo.body()); var row = dojo.create("tr", null, table); var cell = dojo.create("td", null, row); var label = dojo.create("label", {for:"fieldId", innerHTML:"SomeText"}, cell);
Dojo create documentation
source share