I made a form to accept input:

HTML Code:
<form id="formColor" method="POST" action="TestingHTML.html">
<p>Add new color:<br />
<input name="newColorInput" type="text" value="">
<input type="submit" value="GO" onClick="sampleArray()">
I have JS to put the input into an array and show it in the console:

function sampleArray() {
    "use strict";
// make array
	var colors2 = [];
// obtain new array item from form
	var form = document.getElementById('formColor');
	var newColorInput = formColor.newColorInput.value;
	var newColor = newColorInput;
console.log ("new color = " + newColor);
Then I added to just above </body>:

/* execute the functions */
When I enter a word, it merely flashes briefly on the screen and console. How do I code to get the word to remain in the array so it stays on the screen?