title: Extracting values from a table in Javascript
body: <p>Please I tried getting the values imputed by the user but when I input the value and cluck submit, the page reloads without showing the values. any help please. Thank you</p>
  
  <pre><code>var body = document.body,
      tbl = document.createElement('table');
  tbl.style.width = '100px';
  tbl.style.border = '2px solid yellow';
  var n = 10
  for (var i = 0; i &lt; n; i++) {
      var tr = tbl.insertRow();
      var td = tr.insertCell(0);
      var tf = tr.insertCell(0);
      var input = document.getElement('input');
      input.name = "input2";
      input.id = "input2";
      input.value = "";
      var clone = input.cloneNode();
      clone.name = "input1";
      clone.id = "input1";
      td.appendChild(clone);
      tf.appendChild(input);
      td.style.border = '2px solid  yellow';
      tf.style.border = '2px solidyellow';
  }
  var form = document.createElement("form");
  form.appendChild(tbl);
  body.appendChild(form);
  var submit = document.createElement("input");
  submit.type = "submit";
  Submit.on click = 'show()'
  
  function show() {
      var c = document.getElementById("input2").value;
      document.write(c.value);
  }
  form.appendChild(submit)
  tableCreate();
  var c = document.getElementById("input2");
  document.write(c);
  </code></pre>