开发者

Jquery table tr:odd

开发者 https://www.devze.com 2023-03-15 08:22 出处:网络
I have this js code: $(\".main-vervolg .right .bottom .panes table.grey tbody tr:odd\").css(\"background-color\", \"#f8f8f8\");

I have this js code:

$(".main-vervolg .right .bottom .panes table.grey tbody tr:odd").css("background-color", "#f8f8f8");

And it is working fine but when I have 2 separated tables with the class grey he is counting further in the second table but I want that he will starts again开发者_如何学C.

How can I do this?


Try the following:

$('.main-vervolg .right .bottom .panes table.grey').each(function() {
  $('tbody tr:odd', this).css("background-color", "#f8f8f8");
});

It loops through all tables with selector

0

精彩评论

暂无评论...
验证码 换一张
取 消