0
[SOLVED] name=ââ vs value=ââ
Whatâs the difference?
4 Answers
+ 2
Name is what is displayed, value is what it is. Usually you set the value to be a different aspect of the named object.
e.g.
amount of fruit: name = apples, value = 6, name = oranges, value = 3
weather report: name = London, value = rainy, name = Paris, value = sunny
+ 7
The name can be any, serves to bind and combine the fields of one type. The value in contrast to the name is visible to the user and it is sent to the server.
+ 2
Anna's description is better and more accurate than mine, please take a look at this link as well: https://teamtreehouse.com/community/whats-the-difference-between-the-value-and-name-attribute
0
so theyâve written
<input type=âcheckboxâ name=âgenderâ value=â1â/> Male
but only âMaleâ is whatâs visible to the user, so why write âgenderâ in the name element? It doesnât seems to be doing anything.