Skip to main content

Bug Tracker

Side navigation

#10554 closed bug (worksforme)

Opened October 21, 2011 04:14PM UTC

Closed October 22, 2011 09:27AM UTC

Last modified October 24, 2011 01:23PM UTC

Problem with $("input[type=range]") in IE8

Reported by: matt@mxd120.com Owned by: matt@mxd120.com
Priority: low Milestone: None
Component: selector Version: 1.6.4
Keywords: Cc:
Blocked by: Blocking:
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>
Attachments (0)
Change History (4)

Changed October 21, 2011 04:15PM UTC by anonymous comment:1

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

Changed October 22, 2011 01:28AM UTC by dmethvin comment:2

owner: → matt@mxd120.com
status: newpending

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.

Changed October 22, 2011 09:27AM UTC by addyosmani comment:3

component: unfiledselector
priority: undecidedlow
resolution: → worksforme
status: pendingclosed

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+.

Changed October 24, 2011 01:23PM UTC by mpdonadio comment:4

_comment0: 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, so I think it is safe to assume that this will not be an issue once 1.7 goes live. \ 1319563318269314

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.