Guest User

Untitled

a guest
Oct 30th, 2017
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.96 KB | None | 0 0
  1. $(document).on("click", ".btnInsere", function () {
  2.  
  3. var _id = $('#divSP').find('input[name=txtValor]').data('valor');
  4.  
  5. });
  6.  
  7. <div id="divSP">
  8. <table id="tblPrincipal"
  9. <thead>
  10. <th>
  11. <td></td>
  12. <td></td>
  13. </th>
  14. </thead>
  15. <tbody>
  16. <tr>
  17. <td>
  18. <!--Table 1-->
  19. <table>
  20. <thead>
  21. <th>
  22. <td> </td>
  23. <td></td>
  24. </th>
  25. </thead>
  26. <tbody>
  27. <tr>
  28. <td><input type="text" class="txtValor" name="txtValor[]" id="@item.valor" data-valor="@item.valor" value="Arroz"/> </td>
  29. <td><input type="button" class="btnInsere" name="btnInsere" id="btnInsere" value="Insere"/></td>
  30. </tr>
  31. </tbody>
  32. </table>
  33. </tr>
  34. <tr>
  35. <!--Table 2-->
  36. <table>
  37. <thead>
  38. <th>
  39. <td> </td>
  40. <td></td>
  41. </th>
  42. </thead>
  43. <tbody>
  44. <tr>
  45. <td><input type="text" class="txtValor" name="txtValor[]" id="@item.valor" data-valor="@item.valor" value="Feijão"/> </td>
  46. <td><input type="button" name="btnInsere" id="btnInsere" value="Insere"/></td>
  47. </tr>
  48. </tbody>
  49. </table>
  50. </tr>
  51. <tr>
  52. <!--Table n... -->
  53. <table>
  54. <thead>
  55. <th>
  56. <td> </td>
  57. <td></td>
  58. </th>
  59. </thead>
  60. <tbody>
  61. <tr>
  62. <td><input type="text" class="txtValor" name="txtValor[]" id="@item.valor" data-valor="@item.valor" value="Salada"/> </td>
  63. <td><input type="button" name="btnInsere" id="btnInsere" value="Insere"/></td>
  64. </tr>
  65. </tbody>
  66. </table>
  67. </td>
  68.  
  69. </tr>
  70. </tbody>
  71. </table>
  72. </div>
Add Comment
Please, Sign In to add comment