I am a newbie when it comes to javascript, I’m playing with different tutorials and trying to make my own simple things to get a better understanding of it all. Today’s learning is all about passing parameters through a function. What I would like to do is have a user fill a form in, submit those answers to variables in javascript and then call a function via an onClick event which will then display all the data entered into the form.
Firstly I hope this makes sense and secondly I hope that its the correct use of javascript, Im just trying to get a better understanding of passing params to be honest.
Could anyone advise any resources or point me in the right direction on where to get started with this small project
form elements are
select,input,textarea.On form, add a submit event handler which does the following
Using
document.getElementsByTagNamemethod, you can get a array of all such elements in the form.All these elements have a
valueproperty which will return the current value in it. Using this, you can create a string will the current data when form is submitted.