I have to create using 3 arrays one for the questions one for the answers and one for the correct answers so it compares it to the users answers, which at the end displays the score and percentage. I'm totally lost on how to do this as I'm not good at JS this is what I have come up with but can't seem to get the line break to work. Would appreciate help. <html> <body> <script type="text/javascript"> var Questions = new Array(9); var Questions = ['What colour was Arsenals First Kit?','Arsenals Stadium Name?','Arsenals Top Scorer?','Arsenal Team Colours?','Arsenals Manager?','Who did they lose to in the Championsleague Final?','What nationalilty is Robin van Persie?','Arsenals Captain?','Where did Arsenal Finish Last Season?','Where are Arsenal based?']; var Answers = new Array(29); var Answers = ['Red','White','Redcurrent','Wembley','Emirates Stadium','Highbury','Wright','Henry','Bergkamp','Red and White','Yellow','Black','Wenger','Taylor','Rioch','Real Madrid','Barcelona','Liverpool','German','Dutch','French','Clichy','Vermaelen','Fabregas','Second','Third','Fourth','Nottingham','Birmingham','London']; var Correct = new Array(9); var Correct = ['Redcurrant','Emirates Stadium','Henry','Red and White','Wenger','Barcelona','Dutch','Fabregas','Third','London']; document.write(Questions[0]|<BR>); document.write(Answers[0]<BR>); document.write(Answers[1]<BR>); document.write(Answers[2]<BR><BR>); document.write(Questions[1]<BR>); document.write(Answers[3]<BR>); document.write(Answers[4]<BR>); document.write(Answers[5]<BR><BR>); document.write(Questions[2])<BR>; document.write(Answers[6]<BR>); document.write(Answers[7]<BR>); document.write(Answers[8]<BR><BR>); document.write(Questions[3]<BR>); document.write(Answers[9]<BR>); document.write(Answers[10]<BR>); document.write(Answers[11]<BR><BR>); document.write(Questions[4]<BR>); document.write(Answers[12]<BR>); document.write(Answers[13]<BR>); document.write(Answers[14]<BR><BR>); document.write(Questions[5]<BR>); document.write(Answers[15]<BR>); document.write(Answers[16]<BR>); document.write(Answers[17]<BR><BR>); document.write(Questions[6]<BR>); document.write(Answers[18]<BR>); document.write(Answers[19]<BR>); document.write(Answers[20]<BR><BR>); document.write(Questions[7]<BR>); document.write(Answers[21]<BR>); document.write(Answers[22]<BR>); document.write(Answers[23]<BR><BR>); document.write(Questions[8]<BR>); document.write(Answers[24]<BR>); document.write(Answers[25]<BR>); document.write(Answers[26]<BR><BR>); document.write(Questions[9]<BR>); document.write(Answers[27]<BR>); document.write(Answers[28]<BR>); document.write(Answers[29]<BR><BR>); </script> </body> </html>
Ive solved the line break solution with this,I believe I have to use a form and radio buttons how would I incorporate this into my code. Whilst still using the 3 arrays? <html> <body> <script type="text/javascript"> var Questions = ['What colour was Arsenals First Kit?','Arsenals Stadium Name?','Arsenals Top Scorer?','Arsenal Team Colours?','Arsenals Manager?','Who did they lose to in the Championsleague Final?','What nationalilty is Robin van Persie?','Arsenals Captain?','Where did Arsenal Finish Last Season?','Where are Arsenal based?']; var Answers = [['Red','White','Redcurrent'],['Wembley','Emirates Stadium','Highbury'],['Wright','Henry','Bergkamp'],['Red and White','Yellow','Black'],['Wenger','Taylor','Rioch'],['Real Madrid','Barcelona','Liverpool'],['German','Dutch','French'],['Clichy','Vermaelen','Fabregas'],['Second',' Third','Fourth'],['Nottingham','Birmingham','London']]; var Correct = new Array(9); var Correct = ['Redcurrant','Henry','Red and White','Wenger','Barcelona','Dutch','Fabregas','Third','London']; for (var i = 0; i < Questions.length; i++) { document.write(Questions + "<br>"); for (var j = 0; j < Answers.length; j++) { document.write(Answers[j]+"<br>"); } document.write("<br>"); } </script> </body> </html>