I have a table which populate like this, code is given below. when i got the table data from this, i got the image but after that i am unable to click on image. I dont know why i am unable to click it, can anyone please help.
$('#tbdydata').html('');
var FinalHTML = '';
$.each(data, function (i, item) {
var html = "<tr><td>" + item.StructureName + "</td>";
html += "<td>" + item.BuildingValue + "</td>";
html += "<td>" + item.AvgCapacity + "</td>";
html += "<td>" + item.PeakCapacity + "</td>";
html += "<td>" + item.TenureValue + "</td>";
html += "<td>" + item.StoreysValue + "</td>";
html += "<td>" + item.ConditionValue + "</td>";
html += "<td id=" +item.StructureName + ">" + "<a class=" + "dltCls" + ">" + "<img src='../Images/icon_delete.png' alt='Delete' title='Delete Structure' />" + "</a>" + "</td>" + "</tr>";
FinalHTML = FinalHTML + html;
});
$('#tbdydata').html(FinalHTML);
and click image code is given below
$(document).ready(function () {
//$('#myClass').click(function () {
$("[class=dltCls]").click(function () {
// $('tr:selected').each(function () {
//
$this = $(this);
alert(this);
var StructureName = $this.parent().siblings('td').eq(0).text();
var AvgCpcty = $this.parent().siblings('td').eq(2).text();
var PeakCapacity = $this.parent().siblings('td').eq(3).text();
var StructureID1 = $this.parent().siblings('td').eq(7).text();
var StructureID = $('#hdnStructID_' + StructureName).val();
var BuildingAge = $('#hdnBuilding_' + StructureName).val();
var Tenure = $('#hdnTenure_' + StructureName).val();
var Storey = $('#hdnStorey_' + StructureName).val();
var Condition = $('#hdnCondition_' + StructureName).val();
//alert(StructureID + ' ' + StructureName + ' ' + BuildingAge + ' ' + Tenure + ' ' + Storey + ' ' + Condition + ' ' + Storey);
// alert($('#hdnTenure').val());
// alert($('#hdnStorey').val());
// alert($('#hdnCondition').val());
// alert($this.parent().siblings('td').eq(4).val());
// alert(StructureName + ' ' + AvgCpcty + ' ' + PeakCapacity);
$('#txtStructName').val(StructureName);
$('#txtAvgCap').val(AvgCpcty);
$('#txtPkCap').val(PeakCapacity);
$('#txtStructureID').val(StructureID);
$('#AddStructure').hide();
$('#UpdateStructure').show();
$("#ddlTenure").val(Tenure);
$("#ddlStorey").val(Storey);
$("#ddlCondition").val(Condition);
$("#ddlBldgAge").val(BuildingAge);
$("#hdnUpStructID").val(StructureID);
});
});