title: JavaScript - Add Value from input box to array
body: <p>The objective is to add another item to the array, and make an array like ["Car", "House" , "Boat"] etc.</p>
  
  <p>What is happening is when i console log, i only have one item in my array and not all the values i submit from form.</p>
  
  <p>This is my form</p>
  
  <pre><code>&lt;form onsubmit="guardarNumeros()"&gt;
   &lt;p&gt;Please insert the items&lt;/p&gt;
   &lt;input type="text" id="box"&gt;
   &lt;input type="submit" value="Submit"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>My js</p>
  
  <pre><code>function guardarNumeros(){
  
   var items = [];
   boxvalue = document.getElementById('box').value;
   items.push(boxvalue);  
   console.log(items);
  
  }
  </code></pre>
  
  <p>Thank You !</p>