title: Invoking a JS function from outside of html
body: <p>I'm uber new to js. I looked around at couple of other posts and it seems like this should be able to work.</p>
  <pre class="lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
      &lt;script type=&quot;text/javascript&quot; src=&quot;./web3.min.js&quot;&gt;&lt;/script&gt;
      &lt;script type=&quot;text/javascript&quot; src=&quot;./request_balance_script.js&quot;&gt;&lt;/script&gt;
      &lt;script type=&quot;text/javascript&quot; src=&quot;./get_hash.js&quot;&gt;&lt;/script&gt;
      &lt;script language=&quot;javascript&quot;&gt;
          getHash()
      &lt;/script&gt;
  &lt;body&gt;
      &lt;h1&gt;Transaction Hash Fetch.&lt;/h1&gt;
      &lt;p&gt;Here is the hash for &quot;Transfer(address,address,uint256)&quot;&lt;/p&gt;
      &lt;div id=&quot;output&quot;&gt;&lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  <p>Here is what <code>./get_hash.js</code> looks like.</p>
  <pre><code>function getHash() {
      console.log(&quot;Preparing to hash transaction.&quot;);
      var hash = web3.utils.keccak256(&quot;Transfer(address,address,uint256)&quot;);
      console.log(&quot;Hashed transaction =&quot;+hash);
      document.getElementById(&quot;output&quot;).innerHTML = hash;
  }
  </code></pre>
  <p>Why would <code>getHash()</code> be undefined?</p>