I have a table where each row has 13 TD elements. I want to show and hide the first 10 of them when I toggle a link. These 10 TD elements all have an IDs with the prefix "foo" and a two digit number for its position (e.g., "foo01"). What's the fastest way to select them across the entire table?
$("td:nth-child(-n+10)")
or
$("td[id^=foo]")
or is it worth concatenating all of the ids?
$("#foo01, #foo02, #foo03, #foo04, #foo05, #foo06, #foo07, #foo08, #foo09, #foo10")
Is there another approach I should be considering as well?