title: Can a JavaScript variable be used in plain HTML?
body: <p>What I mean is, can a variable/array declared and initialized be used in HTML, outside the <code>&lt;script&gt;</code>-tags? Fx.</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  var foo = array('placeholder1', 'placeholder2');
  &lt;/script&gt;
  
  &lt;body&gt;
  &lt;p&gt;&lt;!--access the variable here--&gt;foo[0]&lt;/p&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>How do you access the variable/array in this case? like this:</p>
  
  <pre><code>&lt;p&gt;&lt;script type="text/javascript"&gt;document.print(foo[0])&lt;/script&gt;&lt;/p&gt;
  </code></pre>
  
  <p>??</p>