Ticket #10148 (closed bug: fixed)
hidden inputs are not :enabled in IE6/7
| Reported by: | jquery@… | Owned by: | |
|---|---|---|---|
| Priority: | low | Milestone: | None |
| Component: | selector | Version: | 1.6.2 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
I would expect that is(':enabled') implies !is(':disabled') and vice versa, and this seems to be the case in most browsers. However, in IE 7.0.5730.13, my test case fails when it finds an <input type="hidden"> element that is apparently neither enabled nor disabled.
Link to test case: http://jsfiddle.net/joshuaecook/3fvJ7/1/
Change History
comment:1 Changed 22 months ago by timmywil
- Priority changed from undecided to low
- Status changed from new to open
- Component changed from unfiled to selector
- Summary changed from is(':enabled') and is(':disabled') are not complementary in IE7 to hidden inputs are not :enabled in IE6/7
comment:2 Changed 22 months ago by dmethvin
Lots of ancient history here.
https://github.com/jquery/sizzle/commit/93e33dc2a41e2b0aa0e1e1c66368f5d224da80e1
As of that commit in 2008, a disabled/enabled element must have a property that is a boolean value, so that :enabled checks elem.disabled===false and won't say an arbitrary element is enabled. The check for type !== "hidden" predates the Github repo and seems to be the real issue here.
Logically it does seem like these should be complements of each other, but it's been broken this way for a LONG time.
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

Simplified test case: http://jsfiddle.net/timmywil/3fvJ7/6/