【发布时间】:2020-01-06 17:45:50
【问题描述】:
需要更新嵌套的 div 和 span。
HTML:
<table id="item_table" data-role="table">
<thead>
<tr>
<th> </th>
<th scope="col" width="100px">Name</th>
<th scope="col" width="100px">Address</th>
<th scope="col" width="150px">Status</th>
</tr>
</thead>
<tbody>
<tr class="item" id="APPLE">
<td>APPLE</td>
<td width="100px"></td>
<td width="100px"></td>
<td width="50px">
<div id="item-status">
<img id="status-image" src=""></img>
<div>
<span></span>
</div>
</div>
</td>
</tr>
</tbody>
</table>
如何编写 jquery 代码,以便可以像这样更新行的最后一列。需要更新 id="item-status" 的类并添加 img
<td width="50px">
<div id="item-status" class="not_found">
<img src="some_image.png"></img>
<div>
<span>
Not found
</span>
</div>
</div>
【问题讨论】: