function clickRow(dataTable) { $j(dataTable).find('tr').each(function(){ var href = $j(this).find("a").attr("href"); $j(this).find('td').each(function(aa,bb) { if(aa != 0) { $j(this).click(function() { if(href) { //console.log(href); window.location = href; } }); } }); }); }