Checkbox question

Checkbox question

I have a simple checkbox. I need to know if it's end position is on or off upon submit. The problem is that no matter if the button is clicked once or twice, the ALERT is always "on"... I need to know how to make it "true" if clicked and "false" if unclicked...or ON/OFF...either way. I've tried a couple things but to no avail. 

Thanks,
Shadraq

  1. /*js*/
  2. $("#class04").on("change", function(event){
  3. setChildClassAttended04($(this).val());
  4. alert($(this).val());
  5. });
  6. $("#classElem").on("change", function(event){
  7. setChildClassAttendedElem($(this).val());
  8. alert($(this).val());
  9. });
  10. /*html*/
  11. <span id="checkClass">
  12.                                 <span id="spanClass04"><input type="checkbox" id="class04" /><label for="class04">0-4</label></span>
  13.                                <span id="spanClassElem"><input type="checkbox" id="classElem"/><label for="classElem">Elementary</label></span>
  14.                             </span>