title: Cannot read property 'split' of null returns NaN
body: <p>i have made this function that takes value from the count of words there are in a string and multiplies it from a custom price. Both values are taken from input fields. However it gets me an error by calling this function "NaN". Can you spot the problem here?</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>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
   &lt;head&gt;
    &lt;title&gt;Telegramma&lt;/title&gt;
  
    &lt;script&gt;
    var string = document.getElementById("text");
    var words = new Number (string.split(" ").length);
    var price = new Number (document.getElementById("price").value);
  
    function showPrice(){
    var total = new Number (words * price);
     document.getElementById("showPrice").innerHTML = total;
  }
    &lt;/script&gt;
  
   &lt;/head&gt;
  
  
   &lt;/body&gt;
  
  &lt;/html&gt;</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;body&gt;
  Text:&lt;input id = "text" type = "text"/&gt;
  Price per a word &amp;euro;&lt;input id = "price" min="0.01" step="0.01" type = "number" /&gt;
  
  &lt;button onclick = "showPrice()"&gt;Get the full price&lt;/button&gt;
  
  &lt;p id = "showPrice"&gt; &lt;/p&gt;</code></pre>
  </div>
  </div>
  </p>