Try this "template"html-approach" which is acceptable for small JS projects
function checkmsg(animal, inputis) {
console.log(animal, inputis.checked); // Do stuff
}
<input type="checkbox" oninput="checkoninput="msg('dog', this)" />Do you have a dog? <br>
<input type="checkbox" oninput="checkoninput="msg('frog',this)" />Do you have a frog?<br>
...