function HideSectionTwo() {
// If correct answers are checked
if(document.getElementById("S1Q1A").checked == true) {
document.getElementById("sectiontwo").style.display = "";
}
//else if nothing is checked
else {
document.getElementById("sectiontwo").style.display = "none";
}
}
I'm new to JavaScript, but i'm trying to create a multiple choice quiz in with 4 questions in each section. Once all the answers have been correctly answered in that section then it will display the next section. For my HTML I'm using tables and have the entire section stored in these individual tables which have id's labeled "sectionone", "sectiontwo" and so on. The code above is what I have been working from. I tried getElementByClass and assigned my elements names by class, but it didn't work. I'm just kind of stuck and need some insight on which direction to go.
My script works for selecting single answers. If i select Section 1 Question 1 answer A the table that has an id of "sectiontwo" will display.