#7184 closed bug (invalid)
two tables make selector error
Reported by: | 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 follow-up: 2 Changed 13 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
comment:2 Changed 13 years ago by
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 ?
Your selector
$("table tr:gt(0)")
selects all tr elements except the first (zeroth) one.