我使用jQuery动态创建下表...执行我的代码后,我得到如下表:
<table id="TableView" width="800" style="margin-left: 60px">
<tbody>
<tr>
<th>Module</th>
<th>Message</th>
</tr>
<tr class="item">
<td> car</td>
<td>
<input class="name" type="text">
</td>
<td>
<input class="id" type="hidden" value="5">
</td>
</tr>
<tr class="item">
<td> bus</td>
<td>
<input class="name" type="text">
</td>
<td>
<input class="id" type="hidden" value="9">
</td>
</tr>
Run Code Online (Sandbox Code Playgroud)
我曾经像这样迭代表:
$("tr.item").each(function() {
var quantity1 = $this.find("input.name").val();
var quantity2 = $this.find("input.id").val();
});
Run Code Online (Sandbox Code Playgroud)
通过使用我得到第一行单元格值以上查询只...帮助我与jQuery将通过该表的完整行迭代,并在获得该行的单元格值quantity1和quantity2.
当我通过文本"选择列表"或"删除列表"时,如何获取段落的ID.
"<p id="section_548540600_title" class="CollapseExpand CollapseExpand_active" title="Collapse / Expand"><a href="javascript:void(0);">Selection List</a></p>"
"<p id="section_362548963_title" class="CollapseExpand CollapseExpand_active" title="Collapse / Expand"><a href="javascript:void(0);">Deletion List</a></p>"
Run Code Online (Sandbox Code Playgroud)