checkbox returns on as value code example
Example: how to take value only from the checked checkbox
document.getElementById('select').onclick = function() {
var checkboxes = document.getElementsByName('vechicle');
for (var checkbox of checkboxes) {
if (checkbox.checked)
document.body.append(checkbox.value + ' ');
}
}