I want to add a value to a checkboxlist using javascript /jquery.The code below is my sample code
function getExpertise() {
$.ajax({
type: "POST",
url: "Sample.asmx/GetExpertiseBySpecialization",
data: "{sId: '" + $('#<%=ddlSpecialization.ClientID%>').val() + "'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(response) {
var expertise = (typeof response.d) == 'string' ? eval('(' + response.d + ')') : response.d;
$('#<%=chkExpertise.ClientID%>').attr('disabled', false).removeOption(/./).addOption('-1', 'Please select expertise');
for (var i = 0; i < expertise.length; i++) {
var val = expertise[i].Id;
var text = expertise[i].Expertise;
$('#<%=chkExpertise.ClientID%>').addOption(val, text, false);
}
}
});
}