156
rated 0 times
[
163]
[
7]
/ answers: 1 / hits: 87989
/ 14 Years ago, tue, august 10, 2010, 12:00:00
What I mean is, can a variable/array declared and initialized be used in HTML, outside the <script>
-tags? Fx.
<script type=text/javascript>
var foo = array('placeholder1', 'placeholder2');
</script>
<body>
<p><!--access the variable here-->foo[0]</p>
</body>
How do you access the variable/array in this case? like this:
<p><script type=text/javascript>document.print(foo[0])</script></p>
??
More From » arrays