Side navigation
#10018 closed bug (duplicate)
Opened August 10, 2011 09:27PM UTC
Closed August 11, 2011 03:27AM UTC
Last modified March 14, 2012 08:33AM UTC
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: | ||
Blocked by: | Blocking: |
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 /> TestInput:<input name="test_input" type="text" value="Test jQuery Bug" style="background:#EEE;" readonly> </body> </html>
The Bug Windows XP & Windows 7 are to be found,in IE6 or IETester-IE6.