Why doesn't combining has() and gt() work in some cases?
I wanted to select any ul which contains more than 3 lis.
This code worked with the 1.2.6 jQuery library:
$("ul:has(li:gt(2))")
.each( function() {
$(this).css("border", "solid red 1px");
});
But not 1.3.2 or 1.4.2.
This code worked with the开发者_开发问答 1.4.2 jQuery library:
$('ul').has('li:nth-child(3)').css('border', 'solid red 1px');
But not v1.2.6.
It's my understanding that jQuery version changes should (generally) not necessitate code changes. Any help understanding this, or differences to be aware of between different versions of the jQuery libraries, would be much appreciated. Thanks!
Clarification:
Why does each version work with one library version, but not the other? Is this a known bug (if so, which one?), or am I doing something wrong? Do documented bugs exist describing these issues on the jQuery site? Should I report the 1.4.2 behavior as a bug?This is called a bug.
I found a similar one here.
精彩评论