title: Unable to generate a multiplication table with user input in JavaScript
body: <p>I have a page which prompts the user to enter a positive integer from 1 to 9, then the javascript code will generate a multiplication table from the input value all the way to 9. I am getting an error in which I cannot retrieve the value and do a multiplication with 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>function timesTable()
  {
      var values = document.getElementById('value1');
  
      var showTables = '';
      for (var i=1; i&lt;9; i++) {
         showTables += values + " x " + i +" = "+ values*i + "\n";
      }
      var p_tables = document.getElementById('tables').innerHTML = showTables;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;label&gt;Enter an integer from 1 to 9 : &lt;/label&gt;
  &lt;input type="text" size=20 id=value1 name="value"&gt;
  &lt;button onclick="timesTable()"&gt;Generate times table&lt;/button&gt;&lt;br&gt; &lt;br&gt;
  &lt;p id="tables"&gt;&lt;/p&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Expected result: 
  <a href="https://i.stack.imgur.com/fiayl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fiayl.png" alt="expectedresult"></a></p>