Ticket #10554 (closed bug: worksforme)
Problem with $("input[type=range]") in IE8
| Reported by: | matt@… | Owned by: | matt@… |
|---|---|---|---|
| Priority: | low | Milestone: | None |
| Component: | selector | Version: | 1.6.4 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
It appears that the selecting for input[type=range] is buggy in IE8 for dynamically added elements to the DOM.
Below is an demonstration of the problem.
In FF, Chome, and IE9 the lengths are reported back as expected (1 and 2). In IE8, the length is 1 both times.
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>jQUery Bug Test</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
<script>
$(document).ready(function () {
$("body").append('<p>' + $("input[type=range]").length + '</p>');
$("body").append('<input type="range" />');
$("body").append('<p>' + $("input[type=range]").length + '</p>');
});
</script>
</head>
<body>
<input type="range" />
</body>
</html>
Change History
comment:2 Changed 19 months ago by dmethvin
- Owner set to matt@…
- Status changed from new to pending
I just tested this in IE8 and it worked: http://jsfiddle.net/LVSaU/ Can you verify?
IE8 doesn't support type="range" and will treat it as text. The attribute is "range" but the property is "text". So support for HTML5 in IE 6/7/8 is non-functional in any case.
comment:3 Changed 19 months ago by addyosmani
- Priority changed from undecided to low
- Resolution set to worksforme
- Status changed from pending to closed
- Component changed from unfiled to selector
Confirmed that http://jsfiddle.net/LVSaU/ works in IE8 as expected. We'll re-open if anyone is still experiencing issues with this in IE8/IE8+.
comment:4 Changed 19 months ago by mpdonadio
Created account in trac, so ticket reporter/ownership can be reassigned if desired.
I did more testing with this.
http://jsfiddle.net/LVSaU/ works, but http://jsfiddle.net/LLuth/ (explicitly using 1.6.4) fails for me on multiple IE8 machines.
I can reproduce the problem using the code from http://code.jquery.com/jquery-1.7b2.js, but I get correct behavior using http://code.jquery.com/jquery-git.js (reporting as "1.7pre Live From Git (f3a4d261ecd0e858515f6e3fa8f5ff59078ec895)") which is the same version that http://jsfiddle.net/LVSaU/ reports.
I read the diffs between the two versions, and am nearly positive that is is a symptom of http://bugs.jquery.com/ticket/10501. I applied that patch to 1.7b2 and the problem goes away.
Regardless, this is a non-issue once 1.7 goes live.
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

Sorry for not using jsFiddle. It was acting up when I was coming up with the test case.