Bug Tracker

Ticket #10018 (closed bug: duplicate)

Opened 3 years ago

Last modified 3 years ago

jQuery 1.6.2 con't remove "readonly" use "attr" in IE6,but 1.4.2 or elem.readOnly can?

Reported by: anonymous Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.6.2
Keywords: Cc:
Blocking: Blocked by:

Description

jQuery 1.6.2 con't remove "readonly" use "attr" in IE6,but 1.4.2 or elem.readOnly can?

Hello, I find a bug in jQuery 1.6.2,look summary.

I come from China, English is poor, but I hope you can see it clearly.

Not much said, look at the code it.

If my question feedback is confirmed, I hope can give me email response, thank you!

The problem in a real IE6 and the IETest-IE6 can all be verified.Other browsers all normal.

Explanation: although I hate the IE6, but in China has more than 30% of the users are still using it, so I must also be for their service.

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Bug Test</title>
<!--1.4.2 Can work normally-->
<!--<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>-->
<!--1.6.2 Can not work normally-->
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script type="text/javascript">

jQuery(function($){

$(":checkbox[name='test_checkbox']:checked").each(function(i){
	//$(":input[name='test_input']").css("background","#FFF")[0].readOnly=false;			//right result
	$(":input[name='test_input']").css("background","#FFF").attr("readonly",false);	//wrong result
	alert("Primary JS Show readOnly = "+$(":input[name='test_input']")[0].readOnly+"\n jQuery Show attr(\".attr\") = "+$(":input[name='test_input']").attr("readonly"));			//Debugging information
});

$(":checkbox[name='test_checkbox']").click(function(){
	if(this.checked){
		$(":input[name='test_input']").css("background","#FFF").attr("readonly",false);
	}else{
		$(":input[name='test_input']").css("background","#EEE").attr("readonly",true);
	}
	alert("Primary JS Show readOnly = "+$(":input[name='test_input']")[0].readOnly+"\n jQuery Show attr(\".attr\") = "+$(":input[name='test_input']").attr("readonly"));			//Debugging information
});

});

</script>
</head>

<body>
CheckBox:<input name="test_checkbox" id="test_checkbox" type="checkbox" value="1" checked><label for="test_checkbox" style="cursor:pointer;">Can Write Test Input</label>
<br /><br />
&nbsp;&nbsp;TestInput:<input name="test_input" type="text" value="Test jQuery Bug" style="background:#EEE;" readonly>
</body>
</html>

Change History

comment:1 Changed 3 years ago by sxnoker@…

The Bug Windows XP & Windows 7 are to be found,in IE6 or IETester-IE6.

comment:2 Changed 3 years ago by dmethvin

  • Status changed from new to closed
  • Resolution set to duplicate

comment:3 Changed 3 years ago by dmethvin

Duplicate of #9879.

Note: See TracTickets for help on using tickets.