title: Javascript Prompt() only working inline and not in external file
body: <p>I have a prompt() variable that only works when it is inside <code>&lt;script&gt;</code> tags in the html file, but do to some constraints I can't do that. Instead I have it in a <code>.js</code> file, but when I refresh the page it doesn't prompt me. The file is loaded, but nothing happens. Any ideas why this happens?</p>
  
  <p>Updated with code</p>
  
  <pre><code>var userChoice = prompt("Do you choose rock, paper or scissors?");
  var computerChoice = Math.random();
  
  &lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
      &lt;title&gt;&lt;/title&gt;
  
      &lt;link rel="stylesheet" type="text/css" href="index.css"&gt;
  
      &lt;script type="text/javascript" href="index.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;div class="display"&gt;
  
      &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>