$('.checkbox').attr('checked',true);
will not work with from jQuery 1.6.
Instead use
$('.checkbox').prop('checked',true);
$('.checkbox').prop('checked',false);
Full explanation / examples and demo can be found in the jQuery API Documentation
https://api.jquery.com/attr/