Please help me out, i need help with this code.I attached this function to the on-click event of a button I need it to automatically write a new question to the page after checking the answer of the previous question, without reloading the page.I need it to loop continuously to the end of the questions array. Please help me out.

[CODE]
function buttonCheckQ_onclick()
{
var answer = 0;
while (document.QuestionForm.radQuestionChoice[answer].checked != true)
{
answer++;
}
answer = String.fromCharCode(65 + answer);
if (answerCorrect (questionNumber, answer) == true)
{
alert("Right answer");
}
else
{
alert("Wrong answer. " + answers[questionNumber] + " is the right answer.");
}
for (var qCounter = 0;qCounter < questions.length; qCounter++)
{
document.getElementById('questionDisplay').innerHTML = "";
QuestionFormDisplay()
window.location.reload()
}
}
[CODE]