title: Why Won't my JS Code Run?
body: <p>For some reason I am getting this issue: Uncaught TypeError: Cannot read property 'value' of null on the document.getElementById line. What is the issue?? I have no clue.</p>
  
  <p>HTML Code:</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;I am a chrome extension&lt;/title&gt;
  &lt;link rel="stylesheet" href="css/style.css" media="screen" type="text/css" /&gt;
  &lt;script src="scripts.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body bgcolor="#34495e"&gt;
   &lt;div class="login-card"&gt;
      &lt;h1&gt;Please Enter Your Birthday&lt;/h1&gt;&lt;br&gt;
    &lt;form&gt;
      &lt;input type="date" name="user" placeholder="Username"&gt;
      &lt;input type="submit" id="age" name="submit" class="login login-submit" value="Submit"&gt;
    &lt;/form&gt;
    &lt;/div&gt;
  &lt;/body&gt; 
  &lt;/html&gt;
  
  scripts.js
  
  function getAge()
  {
      var age = document.getElementById("age").value;
      console.log(age);
  
  }
  document.getElementById('age').onclick = getAge();
  </code></pre>