0
What is the use of id and name in forming html 5 forms??
2 ответов
+ 1
The ' id ' part of HTML, as far as I'm aware, is for the CSS portion of your website to locate a visual element and change it to specified perameters.
The ' name ' attribute... I'm not quite sure.
It could be, again, CSS - but it might be to do with naming conventions.
So it can be displayed in the DOM, etc. :|
+ 1
The id attribute is for uniquely identifying any element (not just form elements). It must be unique throughout the entire document. The name attribute is used by form as the key in a key/value pair when submitting the form. The value attribute is both displayed in the browser, and submitted with the form.