Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

store input into array javascript

values = [];

function addRecord() {
  var inp = document.getElementById('inputtext');
  values.push(inp.value);
  inp.value = "";  
}

function displayRecord() {
  document.getElementById("values").innerHTML = values.join(", ");
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #store #input #array #javascript
ADD COMMENT
Topic
Name
1+4 =