var text = "";
for (var x = 0; x < questions.length; x++)
{
text += (x+1) + ". " + questions[x] + "<br>";
}
document.getElementById("q").innerHTML = text;
I have an array of questions (size=5) and 5 arrays of answers for each questions.
var ans1 = ["answer","answer","answer","answer"];
var ans2 = ["answer","answer","answer","answer"];
var ans3 = ["answer","answer","answer","answer"];
var ans4 = ["answer","answer","answer","answer"];
var ans5 = ["answer","answer","answer","answer"];
var questions = ["q1", "q2", "q3", "q4", "q5"];
With my code, I'm just displaying the 5 questions. I can't figure out how to insert a radio button group of answers for each questions. Help?
(I already did it on java but I can't convert it into javascript. I'm new to it :| ) Thanks in advance