As you may have read, .toggle() was removed after jQuery 1.8 -
Note: This method signature was deprecated in jQuery 1.8 and removed in jQuery 1.9. jQuery also provides an animation method named .toggle() that toggles the visibility of elements. Whether the animation or the event method is fired depends on the set of arguments passed. http://api.jquery.com/toggle-event/
Here is one way to fix the issue -
$('.check:button').click(function () {
if('check all' == $(this).val() ) {
$('input:checkbox').prop('checked', true);
$(this).val('uncheck all');
} else {
$('input:checkbox').prop('checked', false);
$(this).val('check all');
}
});
You'll notice that I switched to prop() instead of attr() as prop() is considered en vogue for elements like this. There has been much debate on "best practices" though but this post makes good reading - .prop() vs .attr()