Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/77.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何检索td输入文本框值?_Javascript_Jquery - Fatal编程技术网

Javascript 如何检索td输入文本框值?

Javascript 如何检索td输入文本框值?,javascript,jquery,Javascript,Jquery,在下表中,单击functionremoveRow,我想检索textbox TXTotalAmount的值 这是我写的 function removeRow(name) { $(name).parent().parent().remove(); var total = $(name).parent().parent().siblings().find("input .classTotalAmount").val(); alert(total);// shows only undef

在下表中,单击functionremoveRow,我想检索textbox TXTotalAmount的值

这是我写的

function removeRow(name) { 
  $(name).parent().parent().remove(); 
  var total = $(name).parent().parent().siblings().find("input .classTotalAmount").val();
  alert(total);// shows only undefined in alert box 
}
这是我的桌子

    <table id="tblitems" cellpadding="0" cellspacing="0" border="0" class="additemtb">
  <tbody>
      <tr>
          <th>Item Name</th>
          <th>Item Code</th>
          <th>Unit Price</th>
          <th>Qty</th>
          <th>UOM</th>
          <th>Amount</th>
          <th>Minimal Order Qty</th>
          <th>FOC</th>
          <th></th>
      </tr>
      <tr>
          <td></td>
          <td></td>
          <td></td>
          <td></td>
          <td></td>
          <td></td>
          <td></td>
          <td></td>
          <td style="width:90px;">
              <a href="javascript:void(0)" class="copy" onclick="copyRow(this);">Copy</a>
              <a href="javascript:void(0)" class="delete" onclick="removeRow(this);">delete</a>
              <a href="javascript:void(0)" class="add" onclick="addRows(this)">add</a>
          </td>
      </tr>
      <tr>
          <td></td>
          <td >Total Amount</td>
          <td>
              <asp:TextBox ID="txtTotalAmount" CssClass="classTotalAmount number" Columns="8" runat="server" ></asp:TextBox>
              <asp:Label ID="Label2" runat="server" CssClass="classCurrency3" />
          </td>
          <td>&nbsp;</td>
      </tr>
  </tbody>
</table>

哪张桌子?放入html代码
var amount = $("#txtTotalAmount").val();