I have an assignment for my course I am battling with. I have to save user input (from answers to 9 math problems) into an array when the "submit" button is clicked and then use the array to perform functions like checking how many answers are correct and showing hit rate. I have written the html with a table and form combination but not sure how to start with the javascript. Thanks!
1 Answer
Give id to all text box like this I have included one text box, You can include it how much ever u want
<input name="text" type="text" maxlength="512" id="answer1" />
<button onclick="myFunction()">Submit</button>
function myFunction(){
var array= [];
var value = document.getElementById('answer1').value
array.push(value);
for(int i=0; i< array.length; i++){
//perform your operations
}}
[]... added to using.push... there's a start