开发者

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

开发者 https://www.devze.com 2023-03-09 20:55 出处:网络
<tr class=\"time\"><td>7:00am</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;<
<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

精彩评论

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

关注公众号