Quoting via <tr> when the table identifier is passed
I have four HTML tables and have to compare data from one table with the one selected by the user. I pass the table id selected by the user to this function, but I don't know how to iterate over the rows of this table:
function callme(code) {
var tableName = 'table'+code;
//alert(tableName);
//How to do loop for this table?? HELP!!
$('#tableName tr').each(function() { //how to do
if (!this.rowIndex) return; // skip first row
var customerId = $(this).find("td").eq(0).html();
alert(customerId);
// call compare function here.
});
}
It should be something very simple for an experienced jQuery programmer. Here is my jsfiddle: http://jsfiddle.net/w7akB/66/
+5
2 answers