I dynamically append some html code (contains input type checkbox) using jquery. the data showing perfectly with class and ids but when i tried to access those input tags (input type checkbox) by using jquery it is not happening. Why? and is there any solution?
My Html
<div id="divData"></div>
My Scripts
<script>
function RollBackVehicles() {
$.ajax({
type: "POST",
url: '@Url.Action("GetData", "Controller")',
async: false,
data: { ID: 1235 },
dataType: "json",
success: function (d) {
var c = "";
for (var b = 0; b < d.length; b++) {
c += "<p> <input type='checkbox'class='clscheck' id='" + d[b].Id + "'/> <span>" + d[b].Value + "</span>"
}
$("#divdata").html(c);
}
});
}
$(".clscheck").change(function () {
alert("Changed");
});
</script>