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.
精彩评论