开发者

How to make an :even declaration more specific

I am wondering how I might make this script more specific. I am thinking that attaching an ID to specify the particular container would would work. How can that be done with the script?

Current state of script:

$('tr:even').addClass('table-alt');

Would this work?

$('#myDiv tr:even').addC开发者_开发百科lass('table-alt');


It will work assuming you have element with ID myDiv that contains table rows. If you don't have such element in the HTML it won't work.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜