title: Undefined value for parseInt()
body: <p>I'm learning Javascript events, but I have a problem about the value I type in an input.</p>
  
  <p>When I type a number, the calcul needs to be change (keyup). Same thing about the option that I choose (change).</p>
  
  <p>But the value that I return with my paragraph (id=res) is undifined. I don't understand what it means and how to debug it.</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>// Here is the Javascript for my events (keyup and change).
  
  document.getElementById("selectDevice").addEventListener('change', change);
  document.getElementById("montant").addEventListener('keyup', change);
  
  function change(e) {
    var montant = Number.parseInt(document.getElementById("montant").value, 10);
    var selectDevice = document.getElementById("selectDevice").value;
    switch (e.target.id) {
    case 'nothing':
      var resultat = montant;
      console.log(resultat);
      break;
    case 'usd':
      var resultat = montant * 1.14;
      console.log(resultat);
      break;
    case 'eur':
      var resultat = montant * 0.82;
      console.log(resultat);
      break;
    }
    document.getElementById("res").innerHTML = resultat
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!-- Here is the HTML --&gt;
  
  Amount: &lt;input id="montant" type="text" /&gt;
  Device: 
  &lt;select id="selectDevice"&gt;
    &lt;option id="nothing" value="nothing"&gt;Please choose a device&lt;/option&gt;
    &lt;option id="usd" value="eur"&gt;EUR&lt;/option&gt;
    &lt;option id="eur" value="usd"&gt;USD&lt;/option&gt;
  &lt;/select&gt;
  Convert amount: &lt;span id="res"&gt;&lt;/span&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>I'm speaking french, I didn't translate all my code, but if you have some questions, I'm here =)</p>
  
  <p>If you have some solutions from the Javascript Documentation, thank you to give me the page, because I need to learn to search in the doc in order to find my solutions by myself.</p>
  
  <p>Have a nice day =)</p>