Side navigation
#6694 closed bug (invalid)
Opened June 20, 2010 06:07PM UTC
Closed November 01, 2010 09:18PM UTC
The selector $('input[type=date]') does not work in ie6
Reported by: | tombigel | Owned by: | |
---|---|---|---|
Priority: | undecided | Milestone: | 1.4.3 |
Component: | selector | Version: | 1.4.2 |
Keywords: | input type date html5 | Cc: | |
Blocked by: | Blocking: |
Description
I'm trying to select <input type='date'/> elements, (html5 type attribute), can't make it work on ie6, works on Webkit/Gecko browsers, don't have another ie version to test it on.
I also tried all the [name=value] variants ($,*,~), didn't work.
I made a small test script and getAttribute('type') returns 'date' so I can't think of a reason for this to happen.
Attachments (0)
Change History (3)
Changed June 20, 2010 07:00PM UTC by comment:1
Changed June 21, 2010 06:49AM UTC by comment:2
@dmethvin
in your example
document.getElementById('sorry').type returns "text"
but
document.getElementById('sorry').getAttribute('type') returns "date"
so ie6 can "see" type=date, it's just a matter of how the framework tries to access this info
Changed November 01, 2010 09:18PM UTC by comment:3
priority: | → undecided |
---|---|
resolution: | → invalid |
status: | new → closed |
HTML attributes are not the same as JavaScript properties.
document.getElementById('sorry').getAttribute('type') returns "date" - Yes, because that's what the value of the attribute says, however, because IE6 doesn't know what a type="date" input element is, it falls back to "text".
I think the problem is that any non-HTML5 browser uses the dynamic type property of "text" for any input type attribute that it doesn't understand.
http://www.w3.org/TR/html401/interact/forms.html#h-17.4.1
For both the selector and .attr(), jQuery is looking at the dynamic type property rather than the attribute. For the test below, IE and Firefox alert "text" rather than "date":