Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
使用 jQuery,我想突出显示第二列包含-字符的所有行。
-
这是第二列的详细信息...
我怎样才能做到这一点?
卢卡斯的2nd答案在 jquery 1.4 中对我不起作用,但这确实:
2nd
$('tr').find('td:eq(1):contains(-)').parent().css('backgroundColor', 'yellow');
$("tr td:eq(1):contains('-')").parent().addClass("highlight");
@recursive:我更改了“eq”的选择器,谢谢。