title: innerHTML with For Loop in Javascript
body: <p>this is my coding. in this coding i want to print table in innerHTML in <p> paragraph tag.This is working but the problem is when i click submit button this result show only last value like this "10*10=100" but i want to run full loop which i define in code from 1 till 10. Please solve this issue.</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;Table Program&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;input type="text" id="table" placeholder="Enter table"/&gt;
  &lt;input type="button" value="Submit" onClick="table()"/&gt;
  &lt;p id="demo"&gt;&lt;/p&gt;
  &lt;!-----------------------------------------------------------------------------------------------&gt;
  &lt;script type="text/javascript"&gt;
  function table()
  {
      var value = document.getElementById("table").value;
      var demop = document.getElementById("demo");
      var a;
      for(a=1; a &lt;= 10;++a)
      {
          demop.innerHTML=(value+"*"+ a +"="+ value*a);
      }
      }
  &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>