Javascript variable access in HTML
<p>Say I have the following JavaScript in a HTML page</p>

<pre><code>&lt;html&gt;
&lt;script&gt;
    var simpleText = "hello_world";
    var finalSplitText = simpleText.split("_");
    var splitText = finalSplitText[0];
&lt;/script&gt;

&lt;body&gt;
    &lt;a href = test.html&gt;I need the value of "splitText" variable here&lt;/a&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>How do I get the value of the variable "splitText" outside the script tags.</p>

<p>Thanks!</p>
