title: JavaScript - parseInt and Number is not working
body: <p>I am trying to do a simple conversion from string (html5 input data) to a integer, but my console log is always returning <code>Undefined</code>, is the same result to <code>Numbers()</code> or <code>ParseInt</code>. If I put a "letter" (do just for test, my form is <code>input="number"</code>).</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var dia = Number(document.getElementById('dia').value)
  var mes = Number(document.getElementById('mes').value)
  var ano = Number(document.getElementById('ano').value)
  
  form.addEventListener('submit', function(e) {
  
    console.log(dia.value)
    console.log(mes.value)
    console.log(ano.value)
  
    e.preventDefault()
  
  })</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;form name="form" action="index.html" method="post"&gt;
    &lt;div class=""&gt;
      &lt;label for="dia"&gt;Dia de Nascimento&lt;/label&gt;
      &lt;input type="number" name="dia" id="dia"&gt;
    &lt;/div&gt;
    &lt;div class=""&gt;
      &lt;label for="mês"&gt;Mês de Nascimento&lt;/label&gt;
      &lt;input type="text" name="mes" id="mes"&gt;
    &lt;/div&gt;
    &lt;div class=""&gt;
      &lt;label for="ano"&gt;Ano de Nascimento&lt;/label&gt;
      &lt;input type="number" name="ano" id="ano"&gt;
    &lt;/div&gt;
    &lt;div class=""&gt;
      &lt;input type="submit" name="" value="Enviar"&gt;
    &lt;/div&gt;
  &lt;/form&gt;</code></pre>
  </div>
  </div>
      </p>
  
  <p>Sorry if it's a kind of lame, i found a lot of toppics about this but i just cannot figure out how to solve. </p>