Test case for jQuery Ticket 5414
live broken when pseudo positional selector is involved
by jitter
HTML
<script src="https://getfirebug.com/firebug-lite-debug.js"></script>
<table id="BeerTable">
<thead id="thead1">
<tr id="tr1">
<th id="th1">Name</th>
<th id="th2">Rating</th>
</tr>
</thead>
<tbody id="tbody1">
<tr id="tr2">
<td id="td1">VB</td>
<td id="td2">3</td>
</tr>
<tr id="tr3">
<td id="td3">Corona</td>
<td id="td4">5</td>
</tr>
<tr id="tr4">
<td id="td5">EB</td>
<td id="td6">1</td>
</tr>
</tbody>
</table>
JavaScript
function RowEvent(event) {
console.log((this.id ? this.id : this.nodeName) + ' clicked!');
}
$(function() {
var rows = $('#BeerTable tbody tr:not(:first)').live("click", RowEvent);
console.log("There are ", rows.length, " elements which match #BeerTable tbody tr:not(:first)");
rows.each(function( i, val ) {
console.log( val.id, " is one of them");
});
rows.css("background-color", "red");
});