Difference between name, id and value attribute

So the cheatsheets aren’t helping me to distinguish the differences

The way I see it is that name attribute is necessary for a form to be submitted (not sure why, the cheatsheet explanation confuses me), and the id connects the label and input? What does value do, can’t find that in the cheatsheets

Using the name attribute, you can send a form element to the server. Several elements can have the same name (e.g. radio buttons, which must have the same name within the set). The id attribute is used to identify any element in a unique way (not just form elements). It has to be different across the whole document.

Using the name attribute, you can send a form element to the server. Several elements can have the same name (e.g. radio buttons, which must have the same name within the set). The id attribute is used to identify

Hey @silverflow

The way I see it is that name attribute is necessary for a form to be submitted (not sure why, the cheatsheet explanation confuses me)

When a form is submitted it is the name attribute and (the user) value that are actually needed

So if you code this:
<input type="text" name="first_name>
And the user in the input type the name Alex.

This will be submitted:
first_name=Alex

This is why it is required to have a name attribute on an input when the form is submitted.

It’s exactly that !

This definition from MDN explain it well:

1 Like

the input still confuses me but I also havent learned Javascript yet, but thanks for the explanations^^