【发布时间】:2016-02-04 15:53:55
【问题描述】:
我想替换 td 在表格中具有特定文本的内容。
这是我正在使用的表结构。
<table id="quotes" width="100%" cellspacing="0" cellpadding="2">
<tbody>
<tr class="rowEven">
<td>Store Pickup Store Pickup</td> <!-- td content to be replaced by "hello" -->
<td class="cartTotalDisplay">$0.00</td>
</tr>
</tbody>
</table>
我想把上面提到的内容换成“你好”
【问题讨论】:
-
$('.rowEven td:first').html('Hello'); -
@Tushar 我必须通过它的内容来获取 td,而不是:first
-
使用
td:contains('your_Text')
标签: jquery html html-table