Here is an example code snippet for the HTML form that will allow the user to enter their personal information:
484 chars16 lines
We also need to create an empty table in our HTML where we’ll show the data that the user entered:
193 chars13 lines
Next, let's write JavaScript code to add a new row to our table each time the user submits the form:
index.tsx864 chars26 lines
This JavaScript function uses the insertRow()
method to add a new row to our table, and then the insertCell()
method to add cells to the new row. Finally, the function gets the values from the form and sets them as the innerHTML of each cell.
Now when the user clicks the "Submit" button, a new row will be added to our table displaying their personal information.
gistlibby LogSnag