Now it's possible to navigate to a tab-pane, but how do I access the table below?
var tdArr = $(this).children()
Use jqeury to get the contents of the cell in the tabbed table table.
The following code comes to mind, but cannot traverse the entire 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">Name</td>
<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">Unit</td>
<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>
0 Answer
Now it's possible to navigate to a tab-pane, but how do I access the table below?
var tdArr = $(this).children()
You should get the tbody tag to get the traversal. Only tbody has multiple tr tags.
这家伙很懒,什么都没留下...