I am a very early beginner who is trying to do something in JavaScript.
Basically I have an HTML form where I am collecting user input. I have a submit button. When on submit, I want my values from the input to be appended to a table as a new row.
I have spent hours trying to find a direction, can someone point me in the right direction?
Since nobody else wants to (or can) provide a pure JS answer, here’s how you can do it with pure JavaScript. If some things are unclear, let me know and I’ll be happy to provide you with useful links and explain what this code does:
HTML:
JavaScript:
In order for this to work, you need to either include this code at the bottom of your HTML file (not reccomended) to ensure the DOM has loaded before you’re trying to change things, or you’ll have to put this code inside an event handler:
Here’s a working fiddle