Simultaneous code in javascript?
<p>How do I have two separate functions run simultaneously? If I wanted two clocks, one to count up and the other to count down, and I wanted them to run at the same time, how would I do it?</p>

<p>If I just did:</p>

<pre><code>var up = 1;
while(true){
    document.write(up);
    up++;
    if(up==11)
        up=1;
}
var down = 10;
while(true){
    document.write(down);
    down--;
    if(down==0)
        down=10;
}
</code></pre>

<p>...it would just keep counting up...</p>
