almacenar la entrada del usuario en la matriz
Necesito hacer lo siguiente (soy un principiante en programación, así que discúlpeme por mi ignorancia): tengo que pedirle al usuario tres datos diferentes en tres cuadros de texto diferentes en un formulario. Luego, el usuario tiene un botón llamado "enter" y cuando hace clic en él, los textos que ingresó en los tres campos deben almacenarse en tres arreglos diferentes, en esta etapa también quiero ver la entrada del usuario para verificar que los datos se estén almacenando en la matriz. He intentado sin éxito que la aplicación almacene o muestre los datos en solo uno de los arrays. Tengo 2 archivos: film.html y functions.js. Aquí está el código. ¡Cualquier ayuda será apreciada!
<code><html> <head> <title>Film info</title> <script src="jQuery.js" type="text/javascript"></script> <script src="functions.js" type="text/javascript"></script> </head> <body> <div id="form"> <h1><b>Please enter data</b></h1> <hr size="3"/> <br> <label for="title">Title</label> <input id="title" type="text" > <br> <label for="name">Actor</label><input id="name" type="text"> <br> <label for="tickets">tickets</label><input id="tickets" type="text"> <br> <br> <input type="button" value="Save" onclick="insert(this.form.title.value)"> <input type="button" value="Show data" onclick="show()"> <br> <h2><b>Data:</b></h2> <hr> </div> <div id= "display"> </div> </body> </html> var title=new Array(); var name=new Array(); var tickets=new Array(); function insert(val){ title[title.length]=val; } function show() { var string="<b>All Elements of the Array :</b><br>"; for(i = 0; i < title.length; i++) { string =string+title[i]+"<br>"; } if(title.length > 0) document.getElementById('myDiv').innerHTML = string; } </code>