I'm making a test that contains questions.
I want the questions to come up on the page randomized rather than in an ordered list.
Here is my HTML:
<ol id = "questionList">
<li id="question">Question text<br/></li>
<li id="question">Question text<br/></li>
</ol>
Here is my javascript:
var questionsList = document.getElementById('question');
var questionArray=[];
var randomize;
for (var i=0; questionsList.length>0; i++) {
questionArray[i]=questionList[i];
}
randomize = questionArray.Math.random()*questionList.length;
document.getElementById("questionsList").innerHTML= randomize;
I cant figure out how to get the questions to appear randomly rather than from #1 down to #10.
Any help is appreciated.