[jQuery] (Mis)Behaviour of not() ?
I've come across some behavior of not() that doesn't match the docs,
or I'm not understanding the docs.
Given the following form:
<form>
<input type=hidden name=a>
<input type=hidden name=b>
</form>
I'd expect "$('form :input:not(:hidden[name=a])')" to return "[<input
type=hidden name=b>]",
since "$('form :hidden[name=a]')" returns "[<input type=hidden
name=a>]" and
and not(selector) should "Filters out all elements matching the given
selector".
However, "$('form :input:not(:hidden[name=a])')" instead returns
"[ ]" (empty array), acting more like
"$('form :input:not(:hidden):not([name=a])')" or "$
('form :input:not(:hidden,[name=a])')" (i.e. "or"ing the selector
parameters instead of "and"ing them).
"$('form :input').not(':hidden[name=a])')" produces the same results
(empty array). I'd expect it to be the inverse of "$
('form :input').filter(':hidden[name=a])')" (which returns "[<input
type=hidden name=a>]".
Am I misunderstanding the docs, or is this a bug with not()?
I get the same results in both 1.2.1 and 1.1.4. Tested on FF2.0.0.8/
Win.
Thanks.
Pete.