The objective is to add another item to the array, and make an array like ["Car", "House" , "Boat"] etc.
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.
This is my form
<form onsubmit="guardarNumeros()">
<p>Please insert the items</p>
<input type="text" id="box">
<input type="submit" value="Submit">
</form>
My js
function guardarNumeros(){
var items = [];
boxvalue = document.getElementById('box').value;
items.push(boxvalue);
console.log(items);
}
Thank You !