Number Keep Changing
<p>I want to change the number by chooesing 6 numbers from 49 numbers, so first I declared a div and have six span in it to contain a number.</p>

<p>And I want to change it by getElementByTagName to assign a new number combined with setInterval to make it always changing but it doesn't work.</p>

<p>Where is my wrong place?</p>

<p>Thx.</p>

<pre><code>function computeRandom(){

var value = new Array(49);//declare array


    for ( i = 0; i &lt; 49; i++ )//initial array_value
        value[i] = i+1;



    for ( i = 0 ;i &lt; 100; i++ ) {//random arrange
        x = parseInt(Math.random()*49);
        y = parseInt(Math.random()*49);
        tmp = value[x];
        value[x] = value[y];
        value[y] = tmp;     
    }


var color = new Array(49);

    for ( i = 0; i &lt; 49; i++ )//store color
        color[i] = "rgb(" + parseInt(Math.random()*255) + "," + parseInt(Math.random()*255) + "," + parseInt(Math.random()*255) + ")";      

    var value_tmp = new Array(6);

    for( i = 0; i &lt; 6; i++)
        value_tmp[i] = value[i];

    document.write("&lt;div style = \"text-align:center;\" &gt;");//center the text by div

        for( i = 0; i &lt; 6; i++)
            document.write("&lt;span  style = \"font-size: 2.5em; display:inline-block; text-align:center; width: 1.5em; background: white; color: " + color[i] + " \" &gt; " 
            + value_tmp[i] + "&lt;/span&gt;&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp");

    var spanArray = document.getElementsByTagName("span");

    setInterval("keepMove(value,spanArray)",10);
    }

function keepMove(val,sp){  

var index = parseInt(Math.random()*43);//set a increment to avoid repeatition

for( i = 0; i &lt; sp.length; i++){
    sp[i].innerHTML = val[i+index];
    document.write(sp[i].innerHTML+"  ");
}
}
</code></pre>

<p>CSS:</p>

<pre><code>#bg {
background: grey;
opacity: 0.8;
}


#hl {
text-align: center;
color: white;
}
</code></pre>

<p>HTML:
sorry I　don't know how to post the HTML?
<a href="http://codepad.org/IrSOsjg7" rel="nofollow">http://codepad.org/IrSOsjg7</a></p>

<p>I have tried the commentor's advice but still not work but thx for your help!
I very appreciate it!</p>
