posted 13 years ago
As Bear said, "They are not interchangeable". However, the name attribute is used outside of form elements. It is used is some meta tags and it is also used in the map element. Note that an id attribute can also be used in a map element but must have the same value as the name attribute if both are used.
The name attribute does not have the same restrictions that the id attribute has. Two forms on the same page can both have sub-elements with the same name attribute value. For example:
<form id="form-A" onsubmit="validate(this)"><input name="fullname"/><input type="submit"/></form>
<form id="form-B" onsubmit="validate(this)"><input name="fullname"/><input type="submit"/></form>
And using the same name value binds a bunch of radio buttons into a group. Neither of these uses is possible with the id attribute.
Larry
Larry Aronson
Author: HTML Manual of Style
http://LarryAronson.com/
@laronson, @HTML5pro