title: Button onclick not calling function
body: <p>My button code looks like this:</p>
  
  <pre><code>&lt;button onclick="submitFunction()"&gt;Submit&lt;/button&gt;
  </code></pre>
  
  <p>And my function code like this:</p>
  
  <pre><code>function submitFunction() {
      alert("example");
  }
  </code></pre>
  
  <p>I've been looking online for an answer and tried a bunch of things, but nothing seems to work. I'm just putting the alert there to see if the function is being called at all.
  I'm using the following to link the files. </p>
  
  <pre><code>&lt;script src="file.js"&gt;&lt;/script&gt;
  </code></pre>