HTML
Example
An HTML form with the name attribute:
First name:
Last name:
Try it »
Browser support





All major browsers support the name attribute.
Definition and Usage
The name attribute specifies the name of the form.
The name attribute is used to reference the element in JavaScript, or to reference the form data after the form is submitted.
Differences between HTML 4.01 and HTML5
none.
Differences between HTML and XHTML
In XHTML, the name attribute is deprecated. Please use the id attribute instead.
HTML Tag