Checkboxes: Check All or None on Webpage

GOAL:  Repeat checkbox multi-select similar to Google Docs and Gmail for editing multiple items in JavaScript / jQuery.

CHECK ALL
$('input:checkbox').attr('checked', true);
UNCHECK ALL
$('input:checkbox').attr('checked', false);