Display a counter variable with JS
<p>I have a rotating slide show I'm working on that uses Javascript.  I use a counter in the function, and I want to display the value of the counter each time the image changes. (so it will say "viewing i of x pictures")</p>

<p>I tried using</p>

<pre><code>&lt;script language="javascript" type="text/javascript"&gt;document.write(i);&lt;/script&gt;
</code></pre>

<p>but it only displays the value of i when the page loads, and it won't update each time i increases.  Is there something better than document.write(i) that will update each time i increases or decreases?</p>
