JQuery checkbox checking

Sometimes Jquery.attr('checked','checked') does not work for many cases.
Jquery newest attribute manipulator .prop() can be used as follows


checking  

$(document).ready(function(){ 
   $('#btn').click(function(){ 
      $('#chk').removeProp('checked'); 
      $('#chk').prop('checked','checked'); 
   }); 
});

http://jsfiddle.net/yxCnK/


Comments

Popular posts from this blog

Log4Net Different files in the same assembly

ටෙස්ලා

Setup Test automation with Selenium and Ruby