jQuery - How to combine has() and gt()
- by KatieK
With jQuery 1.4.2, I can't figure out how to combine has() with :gt. I'd like to select any ul which contains more than 3 lis, so here's what I've tried:
$(document).ready(function(){
$("ul.collapse:has(li:gt(2))")
.each( function() {
$(this).css("border", "solid red 1px");
});
});
This does work with the 1.2.6 jQuery library, but not 1.3.2 or 1.4.2.
I'd appreciate any help in understanding what's going on here. Thanks!