用jqeury获取选中选项卡table表格中单元格的内容
想到了如下 代码,但不能遍历整个表格,望指正,谢谢!
$("div.tab-pane.active").each(function () {
debugger
var tdArr = $(this).children();
var Name = tdArr.eq(0).find('input').val();
});
<div id="Level" class="container tab-pane active" style="margin:2px; font-size:20px;">
<table class="table table-striped">
<tbody>
<tr>
<td>
td>
tr>
<tr>
<td style="font-size:20px;color:#008A7D">Nametd>
<td>
<input type="text" value="pH" class="form-control input-group input-group-lg" data-ajax-success="afterSuccess" data-ajax="true" style="font-size:20px;" id="DisplayName" name="DisplayName" />
<input type="hidden" value="0" id="InDepth" name="InDepth" />
td>
tr>
<tr>
<td style="font-size:20px;color:#008A7D">Unittd>
<td><input type="text" value="" class="form-control input-group input-group-lg" style="font-size:20px;" id="Unit" name="Unit" />td>
tr>
<tr>
<td style="font-size:20px;color:#008A7D">Screen Priority[0,65]td>
<td><input type="text" value="10" class="form-control input-group input-group-lg" style="font-size:20px;" id="Unit" name="Unit" />td>
tr>
<tr>
<td style="font-size:20px;color:#008A7D">Decimals[0,4]td>
<td><input type="button" value="2" class="form-control input-group input-group-lg" style="font-size:20px;" />td>
tr>
<tr>
<td><input type="submit" value="Confirm" class="form-control btn-primary" style="font-size:20px;" />td>
<td><input type="reset" value="Cancel" class="form-control btn-secondary" style="font-size:20px;" />td>
tr>
tbody>
table>
div>
$("div.tab-pane.active table input").each(function (i,v) {
var Name = $(i).val();
console.log(Name)
});