name is the name that is used when the value is passed
(in the url or in the posted data).
id is used to uniquely identify the element for CSS styling and JavaScript.
The id can be used as an anchor too.
In the old days,
<a name was used for that, but you should use the id for anchors too.
name is only to post form data.