Countdown var to loop and display array
<p>I'm very new to javascript and I'm trying to do something I thought would be very basic.</p>

<p>I've created a countdown timer and used "i" as my variable to hold a number from 0-5. And I have an array of "d" from d[0] to d[5] containing strings.</p>

<p>I'm trying to make the timer countdown pass the "i" value into an innerHTML method array value so I want it to display d[5]... d[4]...d[3]... etc.</p>

<p>What am I doing wrong!? Please Help!</p>

<pre><code>&lt;html&gt;&lt;head&gt;&lt;script language="javascript" type="text/javascript"&gt;

var d=new Array():
    d[1]="One";
    d[2]="Two";
    d[3]="Three";
    d[4]="Four";
    d[5]="Five";

    var i=5;

    var i=setInterval("timer()",2000); //1000 will  run it every 1 second

    function timer() {
        i--;
        if (i &lt;= 0)

 clearInterval(countD);
 return;
      }
 }

 document.getElementById(timer).innerHTML = d[i];

 &lt;/script&gt;

 &lt;/head&gt;
 &lt;body&gt;

 &lt;h1&gt;
 &lt;p id="timer"&gt;&lt;/p&gt;
 &lt;/h1&gt;

 &lt;/body&gt;
 &lt;/html&gt;
</code></pre>
