Array list help with javascript

I am trying to create and array of answers using javascript.

can anyone tell me why my code says the answer is undefined rather than what the correct answer is?

here is the part of my .js file that needs checking


 //array of right answers
var right_answer=new Array(); // regular array (add an optional integer
right_answer[0]="Green";       // argument to control array's size)
right_answer[1]="Blue";
right_answer[2]="Red";


function answer(right_answer) {
var correct = right_answer; // This is the correct answer
if (tooLate == 0) {
if(document.getElementById( 'answer').value == correct) {
clearInterval(i);
alert("Right Answer with " + n + " seconds remaining");
}
else{
clearInterval(i);
alert("Incorrect! The answer was " + correct);
}
}


and incase you need it here is my .html file


<html>
<body>

<form>
Points: <select name="ThursAM_First" size="1" id="ThursAM_First" 
		onchange="return no_dupes(this,'ThursAM_Second')">
                  <option value="" selected>&#8226; choose &#8226;</option>
		  <option value=""></option>
                  <option value="1">1</option>
                  <option value="3">3</option>
                  <option value="5">5</option>
                  <option value="7">7</option>
                </select>


</form>

<form name="myform" action="redir2.html" method="post">
<a href="javascript: submitform()"</a>
 
what color is the grass?
<input type = "text" name="pizza" id = "answer">
 
 
</form>
<input type = "button" id = "time" onclick="answer()">
 </body>


This may be unrelated, but your anchor isn’t correct:
<a href=“javascript: submitform()”</a>

You didn’t close the opening tag.

I don’t see where this suddenly came from:
clearInterval(i);

Are we missing a for loop from somewhere?