Opened 14 years ago
Closed 14 years ago
#5208 closed bug (worksforme)
Possible bug involving :not()
Reported by: | plasko | Owned by: | john |
---|---|---|---|
Priority: | minor | Milestone: | 1.4 |
Component: | selector | Version: | 1.2.6 |
Keywords: | :not :first | Cc: | |
Blocked by: | Blocking: |
Description
It seems to me that if you have 3 select lists and each have 10 options and you use this selector:
$('select:not(:first) option:first') it should return 3 elements. It only returns 1
$('select:not(:first)').find('option:first') will return 3 though.
While I'm not 100% sure you guys designed it to work, just that I expected the former (the first option of the not-first select lists) and thought you might want to know.
Change History (2)
comment:1 Changed 14 years ago by
comment:2 Changed 14 years ago by
Resolution: | → worksforme |
---|---|
Status: | new → closed |
Looks like you thought this would return 3 elements correct? But the :first option will only return the one element that is first. You are likely thinking of :first-child which in your case would give you the first option of each of the selects that wasn't first.
$('select:not(:first) option:first-child')
http://docs.jquery.com/Selectors/firstChild
Although technically with your test case that would return 2 since you only have 3 select lists and the first one would be skipped.
In any case, please reopen if that isn't what you meant and attach a test case with code and html as Dave requested so we don't mis-interpret the problem.
Can you provide a test case with complete code and html?