I am using multiple check-boxes for some action. My requirement is to get on if the checkbox is checked and off when it is unchecked. But I am getting the value as on if I check/uncheck the checkbox.
<label class="cont">
<input type="checkbox" name="listingstatus" id="listingstatus<?php echo $doc->module_video_id; ?>" onchange="listingStatus('<?php echo $doc->module_video_id; ?>')">
<span class="checkmark"></span>
</label>
function listingStatus(module_video_id)
{
var a = $('#listingstatus'+module_video_id).val();
console.log(a);
}