Skip to main content

Bug Tracker

Side navigation

#7184 closed bug (invalid)

Opened October 14, 2010 02:38AM UTC

Closed October 14, 2010 02:59AM UTC

Last modified October 14, 2010 03:14AM UTC

two tables make selector error

Reported by: ttndxjcm@gmail.com Owned by:
Priority: undecided Milestone: 1.4.3
Component: unfiled Version: 1.4.2
Keywords: Cc:
Blocked by: Blocking:
Description

<div id="Abc">

<table border="1">

<thead><tr>

<th>站別</th>

<th>帳號</th>

<th>類別</th>

</tr></thead>

<tbody>

<tr>

<td>98</td>

<td>1234</td>

<td>1234</td>

</tr>

</tbody>

</table>

<table border="1">

<thead><tr>

<th>站別</th>

<th>帳號</th>

</tr></thead>

<tbody>

<tr>

<td>98</td>

<td>1234</td>

</tr>

</tbody>

</table>

</div>

$("table tr:gt(0)").live("mouseover mouseout", function(event) {

if (event.type == "mouseover")

$(this).css("background-color", "#FFFF9E");

if (event.type == "mouseout")

$(this).css("background-color", "#FFFFFF");

});

It should be colored from the 2nd tr tag in a table,

but the 2nd table is colored from the 1st tr tag.

Something is wrong ?

Attachments (0)
Change History (2)

Changed October 14, 2010 02:59AM UTC by dmethvin comment:1

resolution: → invalid
status: newclosed

Your selector

$("table tr:gt(0)")
selects all tr elements except the first (zeroth) one.

Changed October 14, 2010 03:14AM UTC by ileadu <ttndxjcm@gmail.com> comment:2

Replying to [comment:1 dmethvin]:

Your selector
$("table tr:gt(0)")
selects all tr elements except the first (zeroth) one.

How to refine it to make every table color from 2nd tr tag ?