Ticket #6591 (closed bug: duplicate)
":enabled" pseudo-selector is wrong
| Reported by: | diyism | Owned by: | |
|---|---|---|---|
| Priority: | undecided | Milestone: | 1.4.3 |
| Component: | selector | Version: | 1.4.2 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
alert($("[name=CreativeID[]]").length);get 6 alert($("[name=CreativeID[]]:disabled").length);get 2
alert($("[name=CreativeID[]]:enabled").length);get 0
it should get 4
Change History
comment:2 Changed 3 years ago by diyism
In my mind, it should be take as "enabled", because its value will be send to the server: <input type="hidden" value="1" name="CreativeID[]">
comment:3 Changed 3 years ago by diyism
For reference, from the HTML 4 spec:
"DISABLED attribute, also new in HTML 4.0, disables the control. Disabled elements are read-only elements with the added restrictions that the values are not submitted with the form, the elements cannot receive focus, and the elements are skipped when navigating the document by tabbing."
Perhaps the most intuitive behavior would be if the ":enabled", ":disabled" selectors selected elements directly corresponding to whether the disabled attribute is set, and nothing more.
quoted from:
http://old.nabble.com/Selector-:enabled-no-longer-finds-hidden-elements-td21734256s27240.html
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

alert($("[name=CreativeID[]]:not(:disabled)").length); get 4