var table = $("<table />").attr({id:'table1'});
var appenddata;
names = Object.keys(res);
var row = $('<tr />');
$(names).each(function (index, value) {
$(row).append("<th>" + value + "</th>");
});
$(table).append(row);
$(Result).each(function (index, value) {
var tr = $('<tr />').attr({});
$(names).each(function (i,iValue) {
$(tr).append("<td>" + value[names[i]]+"</td>");
});
$(table).append(tr);
});
$("#tab1").append(table);
I have this table, I want to add click event on rows, like if user click on anywhere on the row, It shows an alert.