title: Functions in an external javascript file. What am i doing wrong?
body: <p>I'm new to javascript, and I'm trying to run the following code:</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
      &lt;script type="text/javascript" src="script.js"&gt;
      &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;input type="button" onclick="popup()" value="Click Me!" /&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>script.js:</p>
  
  <pre><code>function popup() {
      alert("Hello World")
  }
  </code></pre>
  
  <p>script.js is in the same directory as the html file, but when I push the button it doesn't execute the code. </p>