Name attribute in checkbox and radio

Why is the “name” attribute used in checkbox and radio. what is its use?

Example page Basic HTML and HTML5: Create a Set of Checkboxes

Hi @Harshi_The_Programer!

The name attribute plays an important role when the form is submitted.

Right now, in the context of just html, it doesn’t look that important.

But the name attribute specifies the name for the input element.

Here is deeper explanation on how the name attribute works when a form is submitted.

1 Like