/* getting multiple input's value from tr[i] td[j] */ $("#btnShow").click(function () { $('#TBI table tr:eq(1) td:eq(1):has(input)').each(function () { var row = this; var values = ""; $('input', this).each(function () { values = values + $(this).val() + ","; }); values = values.substring() + " "; alert(values); }); });
Get the data of tr[1] and td[1] by clicking the button. <hr> <div id="TBI"> <table border="1"> <tr class="t-state-selected t-grid-edit-row"> <td> <input id="ijn" type="text" value="hello1" name="ijn" /> <input id="ijn" type="text" value="hello2" name="ijn" /> </td> <td class="t-grid-edit-cell"> <input id="ijn" type="text" value="hello" name="ijn" /> </td> <td>data1</td> </tr> <tr class="t-state-selected t-grid-edit-row"> <td> <input id="ijn" type="text" value="hello11" name="ijn" /> <input id="ijn" type="text" value="hello22" name="ijn" /> </td> <td class="t-grid-edit-cell"> <input id="ijn" type="text" value="hello222" name="ijn" /> </td> <td>data2</td> </tr> </table> </div> <hr> <input type="button" value="Get data" id="btnShow" />