Bug Tracker

Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#7184 closed bug (invalid)

two tables make selector error

Reported by: ttndxjcm@… 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 ?

Change History (2)

comment:1 Changed 13 years ago by dmethvin

Resolution: invalid
Status: newclosed

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

comment:2 in reply to:  1 Changed 13 years ago by ileadu <ttndxjcm@…>

Replying to 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 ?

Note: See TracTickets for help on using tickets.