The answers provided are good and could work but not with my problem. This is because the javascript that generates these html elements is a abstracted file that generates html input controls for many different applications. I can't modify that file to specifically check a checkbox for one case.
What I did was, inside of this generic javascript file, call a setDefaults()
method IF IT EXISTS in the current context. So the callers of this script can choose to implement a setDefaults() that will be called by the generic script, after the html has been generated.
function initReport(reportID) {
//request the data needed to create the dynamic html from the server:
$.ajax({
type: "GET",
url: "/report.aspx/GetReportDetails?reportID=" + reportID,
contentType: "application/json; charset=utf-8",
dataType: "json"
}).done(function (result) {
reportFormData = JSON.parse(result.d);
//request our generic html template:
$.ajax({
type: "GET",
url: "/assets/modules/report/Templates/Form.html"
}).done(function (result) {
$("#Form").html(result);
//generate html from server data:
buildViewModel(reportFormData);
buildPage(reportFormData);
kendo.bind($("#Form"), viewModel);
//call "setDefaults" function only if it has been defined (in the current report template)
if (typeof setDefaults === "function")
{
setDefaults();
}
});
}).fail(function (jqXHR, textStatus, err) {
console.log("An error has occurred: " + err);
});
...
}