+ 2
What is the use of name attribute in HTML forms?
I remove it and also get the same output https://code.sololearn.com/W36iSVO0onPR/?ref=app
2 Answers
+ 1
its for the name of the values in the form element sent, so if you have an input with the name "name" and when you submit, the form data either with a GET or POST it will be name="[input values]" with [input values] being the text you put in <input>
POST method sends your data in form data content type so its hidden but accessible from the server
GET method sends your data in a query string like those text after the ? like /my/endpoint?name=rei
both have same way of sending the data in a key value pair
+ 2
Oh thank you =) I understand