【发布时间】:2011-01-14 05:55:26
【问题描述】:
$('table.listings td:contains("You")').each(function(){
$(this).children('td:nth-child(2)').addClass('highlighted');
});
我在页面上有多个table.listings,但选择了包含“你”的那个,我想将highlighted 添加到每一行的第二个单元格,但上面的代码没有按我预期的那样工作。
【问题讨论】: