I need some help with an assignment I was given. For the assignment, I need to create an array of five names, and display the names in textboxes. I put this array in the script tag, as per the assignment instructions.
var names = ["Jeremy","Arun","Alisa","Rohan","Dana"];
I also put a button in the body of the document,
<button id = "name" onclick = '
name0.value = names[0];
name1.value = names[1];
name2.value = names[2];
name3.value = names[3];
name4.value = names[4];
'>Customer Name</button></th>
When the button is clicked, it is supposed to display names to text boxes, which is displayed in a table. I have provided the code below for the first name in the array.
<td><input type="text" id="name0" size=10 value = ''></td>
Both the text boxes and button are within the body tag if that needs clarification. If you could help me figure out why the names are not displaying, that would help a bunch!