title: Is it possible to refer to function or object from particular script tag in HTML file
body: <p>Imagine we have the following code in an HTML file:</p>
  
  <pre><code>&lt;script id='tag-1'&gt;
    function foo(){
      alert("this is foo-1");
    }
  &lt;/script&gt;
  
  &lt;script id='tag-2'&gt;
    function foo(){
      alert("this is foo-2");
    }
  &lt;/script&gt;
  
  &lt;script id='tag-3'&gt;
    function foo(){
      alert("this is foo-3");
    }
  &lt;/script&gt;
  </code></pre>
  
  <p>Is it possible to invoke function <code>foo</code> from the script tag with id <code>tag-2</code>?
  I'm just curious to know if there is any cross-browser solution? Thank's guys.</p>
  
  <hr>
  
  <p>Ok we have two very relevant proposals -  the one that I marked for accepted answer and another one of the comments rigth below this post - the one that @dfsq propose. Thank you all guys!!!</p>