Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(document).on("click", ".btnInsere", function () {
- var _id = $('#divSP').find('input[name=txtValor]').data('valor');
- });
- <div id="divSP">
- <table id="tblPrincipal"
- <thead>
- <th>
- <td></td>
- <td></td>
- </th>
- </thead>
- <tbody>
- <tr>
- <td>
- <!--Table 1-->
- <table>
- <thead>
- <th>
- <td> </td>
- <td></td>
- </th>
- </thead>
- <tbody>
- <tr>
- <td><input type="text" class="txtValor" name="txtValor[]" id="@item.valor" data-valor="@item.valor" value="Arroz"/> </td>
- <td><input type="button" class="btnInsere" name="btnInsere" id="btnInsere" value="Insere"/></td>
- </tr>
- </tbody>
- </table>
- </tr>
- <tr>
- <!--Table 2-->
- <table>
- <thead>
- <th>
- <td> </td>
- <td></td>
- </th>
- </thead>
- <tbody>
- <tr>
- <td><input type="text" class="txtValor" name="txtValor[]" id="@item.valor" data-valor="@item.valor" value="Feijão"/> </td>
- <td><input type="button" name="btnInsere" id="btnInsere" value="Insere"/></td>
- </tr>
- </tbody>
- </table>
- </tr>
- <tr>
- <!--Table n... -->
- <table>
- <thead>
- <th>
- <td> </td>
- <td></td>
- </th>
- </thead>
- <tbody>
- <tr>
- <td><input type="text" class="txtValor" name="txtValor[]" id="@item.valor" data-valor="@item.valor" value="Salada"/> </td>
- <td><input type="button" name="btnInsere" id="btnInsere" value="Insere"/></td>
- </tr>
- </tbody>
- </table>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
Add Comment
Please, Sign In to add comment