When used with the child selector >
, the two variants of jQuery\'s \"has\" behave differently.
Take this HTML:
I think you may have hit upon a genuine bug. The problem may lie in the way you are using the child selector. As user257493 pointed out, it's not meant to be used on its own (or at least I don't see any examples of that in the documentation.
Check this out though. If you add a *
before the child selector in the .has()
, suddenly it works: http://jsfiddle.net/Ender/FjgZn/
But if you do the same thing in the :has()
selector, it stops working! See here:
http://jsfiddle.net/Ender/FjgZn/
There definitely seems to be difference in the way these two are implemented.