Get CheckBox Checked ids using JQuery

  1. <script>  
  2.     $(document).ready(function() {  
  3.         $('#bt_save').click(function() {  
  4.   
  5.             var Contract_Period = '';  
  6.             var Campaign_Period = '';  
  7.             var Targets = '';  
  8.             var chkActuals = '';  
  9.   
  10.   
  11.             $('input[id="Contract_Period"]').each(function(e) {  
  12.                 if (this.checked) {  
  13.                     Contract_Period = $('#Contract_Period').attr('id');  
  14.                 }  
  15.             });  
  16.             $('input[id="Campaign_Period"]').each(function(e) {  
  17.                 if (this.checked) {  
  18.                     Campaign_Period = $('#Campaign_Period').attr('id');  
  19.                 }  
  20.             });  
  21.   
  22.             $('input[id="Targets"]').each(function(e) {  
  23.                 if (this.checked) {  
  24.                     Targets = $('#Targets').attr('id');  
  25.                 }  
  26.             });  
  27.   
  28.             $('input[id="chkActuals"]').each(function(e) {  
  29.                 if (this.checked) {  
  30.                     chkActuals = $('#chkActuals').attr('id');  
  31.                 }  
  32.             });  
  33.         });  
  34.   
  35.     });  
  36. </script>