开发者

finding the row that has the first TD containing the specified time

<tr class="time"><td>7:00am</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>
        <tr class="time"><td>7:30am</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><开发者_运维知识库td>&nbsp;</td><td>&nbsp;</td></tr>
        <tr class="time"><td>8:00am</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>
        <tr class="time"><td>8:30am</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>
        <tr class="time"><td>9:00am</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>
        <tr class="time"><td>9:30am</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</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.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜