What is the use of name attribute in form tag | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

What is the use of name attribute in form tag

Name attribute

5th Jun 2020, 6:25 AM
Shübhám AnAnd
Shübhám AnAnd - avatar
3 Answers
+ 5
We use it so when a form is submitted, then the backend script can read which values correspond to which inputs. E.g. <input type=“text” name=“username”/> So on the backend, you can access the value with the “username” key.
5th Jun 2020, 6:33 AM
Rowsej
Rowsej - avatar
+ 1
Thanks
5th Jun 2020, 7:12 AM
Shübhám AnAnd
Shübhám AnAnd - avatar
0
Love you all
5th Jun 2020, 7:13 AM
Shübhám AnAnd
Shübhám AnAnd - avatar