+ 1
Can anyone explain me why we must mention name and value in the input attribute
3 Respostas
0
name is for sending the info to another page because without it How do you know what are you sending?
and value is not necessary but if you want a default value you can use it
0
to be frank you don't have to use any of them. especially nowadays when many pages uses Ajax and REST to communicate with server site. just for plain HTML FORM it is recommended to name your inputs so server can decode the attributes from FORM into variables. Furthermore there are distinct naming recommendations for different server side languages for example to map form attribures into an array variable
- 1
name is the title of the input. value is the choice