$("#orderAgentTab").find("tr").each(function(){ var tdArr = $(this).children(); var seq = tdArr.eq(0).text() ;//直接获取<td>值 var inputnum = tdArr.eq(6).find("input").val();//获取<td>中input的值 alert(seq); alert(inputnum); });
- <tbody id="orderAgentTab">
- <tr>
- <td align="center"><input type="text" class="input-s input-w input-hs"></td>
- <td align="center"><input type="text" class="input-s input-w input-hs"></td>
- 5 <td align="center"><input type="text" class="input-s input-w input-hs"></td>
- <td align="center"><a class="" οnclick="history_income_del(this);" href="###">删除</a></td>
- </tr>
- <tr>
- <td align="center"><input type="text" class="input-s input-w input-hs"></td>
- <td align="center"><input type="text" class="input-s input-w input-hs"></td>
- <td align="center"><input type="text" class="input-s input-w input-hs"></td>
- <td align="center"><a class="" href="###">删除</a></td>
- </tr>
- <tr>
- <td align="center"><input type="text" class="input-s input-w input-hs"></td>
- <td align="center"><input type="text" class="input-s input-w input-hs"></td>
- <td align="center"><input type="text" class="input-s input-w input-hs"></td>
- <td align="center"><a class="" href="###">删除</a></td>
- </tr>
- </tbody>