Suraj Suraj - 5 months ago 45
jQuery Question

Some attributes are not working in IE

I am trying to uncheck the checked checkboxes when the page loads.I have used below code its working fine in mozilla and chrome, but its not working IE. So please help me some alternatives. Jquery version is 1.4.4.

$("#filter-form").find("input[type='checkbox']").each( function() {
$(this).removeAttr('checked');
//$(this).attr("checked",false);//just for testing i tried this, but this one also not working in IE.
});

Answer

$(document).ready(function(){
$("#calender-filter-form").find("input[type='checkbox']").each( function() {
  $(this).removeAttr('checked'); 
  //$(this).attr("checked",false);//just for testing i tried this, but this one also not working in IE.
  }); 
  });
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<div id="calender-filter-form">
  <input type="checkbox" checked/>

 <input type="checkbox" checked />
  <input type="checkbox" />
  <input type="checkbox" />
</div>

working in IE 10