//FOR CHECK BOX / SWITCH
var stateValue = $("#yourInputElement").is(":checked");
// will be set to the element value if checked (ON) or will be null otherwise
var stateValue = $("#yourInputElement").is(":checked") ? $("#yourInputElement").val() : null;
//FOR RADIO
var stateValue = $(":radio:checked", radioParentContainer).val();