<tr class="time"><td>7:00am</td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td></tr>
<tr class="time"><td>7:30am</td><td> </td><td> </td><td> </td><td> </td><开发者_运维知识库td> </td><td> </td></tr>
<tr class="time"><td>8:00am</td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td></tr>
<tr class="time"><td>8:30am</td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td></tr>
<tr class="time"><td>9:00am</td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td></tr>
<tr class="time"><td>9:30am</td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td></tr>
I have a basic table that I am using as a timetable, and would like to traverse the tds and trs.
What I want to do is to first use the "contains" selector to find the row with the time I want, then when I have the Row, I want to use "Eq" to choose which column.
$("tr.time:firstChild:contains('"+mytime+"')");
I don't even think that's right.
You want something like this...
$("tr.time td:first-child:contains('" + mytime + "')")
jsFiddle.
精彩评论