I have the following table:
<table summary='' id='table_csrdownloadcenter'>
<thead>
<tr>
<th>text1</th>
<th>text2</th>
<th>text3</th>
<th>text4</th>
<th>text5</th>
<th>text6</th>
<th>text7</th>
<th>text8</th>
</tr>
</thead>
<tbody>
<tr id='nom_du_pdf'>
<td class='dc-date'></td>
<td class='dc-dl'></td>
<td class='dc-title'></td>
<td class='dc-area'></td>
<td class='dc-category'></td>
<td class='dc-file'></td>
<td class='dc-ranking'></td>
<td class='dc-checkbox'><input type='checkbox' name='chk"+PathFile[i]+"' ></td>
</tr>
<tr id='nom_du_pdf2'>
<td class='dc-date'></td>
<td class='dc-dl'></td>
<td class='dc-title'></td>
<td class='dc-area'></td>
<td class='dc-category'></td>
<td class='dc-file'></td>
<td class='dc-ranking'></td>
<td class='dc-checkbox'><input type='checkbox' name='chk"+PathFile[i]+"' ></td>
</tr>
</tbody>
<table>
For each <tr>
I would like to save in a string the value of the name attribute in the 8th <td>
I tried this :
function DownloadZip()
{
$('.DownloadZip').click(function(){
var res = "";
$('#table_csrdownloadcenter').find("tbody").find("tr").find(td:nth-child(8)).find("input").each(function(){
res = $(this).attr("name").text();
alert(res);
}
});
}
Can anyone help me to make this working?