update span tag value with javascript issue
<p>I am trying to simply update a span tag usign the following method...</p>

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

document.getElementById("myspan").innerHTML="newtext";  

&lt;/script&gt;

&lt;span id="myspan"&gt; hereismytext &lt;/span&gt;
</code></pre>

<p>But i am getting the following error:</p>

<p><strong>document.getElementById("myspan") is null</strong></p>

<p>Any ideas as to what is causing this?</p>

<p>Cheers</p>

<p>Rich</p>
