0
What is the use of name attribute in input element??
2 ответов
+ 1
"name" gets submitted to the server once the user presses the submit button so the server can know what kind of data it is
+ 1
on the other hand "id" is more useful for the client side since it can be referenced by javascript using getReferenceById() method.
A big difference is that you can use the same "name" for multiple elements but "id" must be unique