Basically, i have a form which includes multiple options, each of these options filter the result until you have a specific outcome, it uses javascript to do this.
My question is that i have a part in the form with multiple check boxes, and what i want to do is to check if each one is checked and display some data when they are checked. But with more than one being able to be checked.
I cant use any sort of framework so please dont suggest that, and i dont want any big blocks of code (only well explained code), i need this to be explained to me and then i can write my own code (so i can learn), i just dont have any idea how to go about this.
Any explanation of the Javascript needed would be helpful.
EDIT: This is the code i have so far:
function jobs() {
var shownursing = document.getElementById('nursing-block');
if (document.getElementsByName("nursing")[0].checked) {
console.log("hi")
shownursing.style.display = 'block';
return true;
} else {
console.log("no")
shownursing.style.display = 'none';
return false;
}
}
jobs();