How to prompt for a name and then pass the name to a function that will find the given name from the given array with subarrays. I should use the found array element to print out the name in the DOM, the voting status, and the given grade as a table.
For example: [[Jack, true, 10],[John, false],[Rachel, true, 7]]. When user input in prompt is Jack, than in DOM should be printed out: JACK, VOTED, 10 as a table.
Something like
var name = document.getElementById('myInput').value;
for (i=0; i<array.length-1; i++){
if (array[i][0] == name) {
document.getElementById('myDOM').innerHTML = array[i][0] + ',' + array[i][1] + ',' + array[i][2];
};
}
For 'myInput' and 'myDOM' you will want to fill in the IDs of the elements that you are taking the input from and choosing to output to.