Name differs from ID attribute
1, we know that when the Web page to do post submission, is the form (that is, form field) for the submission of units, a form has several form objects (such as <input type= "text" name= "UserName" value= "Please enter the name"/>) , the same page can be more than one form (ASP., it only allows one, and the name must be Form1), after the table single table submitted to the server side, you can directly through the Name property to the value of the form field, but not through the ID directly to the value of the Table Form object.
2. There cannot be more than one HTML tag with the same name attribute in the same form, but if there is more than one form in a Web page, a different form can have the same name attribute tag. While the ID is global, you cannot have multiple nodes in an HTML document using the same ID, regardless of which form it is in.
3, when creating a CSS style, you can create an ID style sheet (prefixed with #), so that the style with the ID directly apply the style, and cannot establish the name style sheet.
4, it is recommended to use the ID to identify a node when making a Web page edit, instead of using name (unless it is required for post submission), the getElementById method is recommended when using JavaScript for DOM node positioning, because only the ID uniquely identifies a node , and there may be multiple nodes with the same name attribute in the same page, which are in separate form.
HTML form
Http://www.w3school.com.cn/tags/tag_form.asp
W3cschool JavaScript Learning