Using checkboxes to control other elements

Using checkboxes to control other elements

I want to use two checkboxes to control the appearance of two blocks. The click method doesn't work well for this situation. I have tried to use the change method, but don't know how to detect which checkboxes are checked. Can someone give a hand please?

  1.     $(':checkbox').change(function(){
  2.           // ....
  3.           $(':checkbox:checked').each(function(){ 
  4.            // ???? 
  5.           });
  6.     });
  7.