hi karthime
I think u are trying to check the checkbox before it is created bcz you r doing it in document.ready and after that u r appending checkbox to div.
so after appending checkbox to the div then you have check the checkbox with the database values wt exactly u made it.
<pre lang="Javascript">
$("#dvModules").append('<span><input type="checkbox" id=Module_' + jsModulesData[ctr].Code + ' name="' + jsModulesData[ctr].Name + '" value="' + jsModulesData[ctr].Code + '"> ' + jsModulesData[ctr].Name + '</span><br />');
SelectedModuleIDs = '@ViewBag.SelectedModuleIDs';
var arrModuleIDs = SelectedModuleIDs.split(',');
for (var i = 0; i < arrModuleIDs.length; i++) {
$("#Module_" + arrModuleIDs[i] + "").attr('checked', true);
}
Happy coding ..... :)
Seshu