HTML <input> name Attribute
HTML <input> tag
Example
An HTML form with two text fields and one submit button:
<form
action="form_action.asp"
method="get">
Name: <input type="text" name="fullname"
/><br />
Email:
<input type="text" name="email" /><br />
<input type="submit" value="Submit" />
</form> |
Try it yourself »
|
Definition and Usage
The name attribute specifies a name for an input element.
The name attribute is used to identify form data after it has been submitted
to the server, or to reference form data using JavaScript on the client side.
Note: Only form elements with a name attribute will have their values
passed when submitting a form.
Browser Support

The name attribute is supported in all major browsers.
Syntax
Attribute Values
| Value |
Description |
| name |
The name of an input element |
HTML <input> tag
Start Creating a stunning, Flash website. It's easy and free!
Wix is a revolutionary web design tool that provides you with a free, simple,
drag & drop editing platform to create your own professional and beautiful website.
Over 2 Million users have created their website with Wix.
Now create yours!
 |
W3Schools' Online Certification
The perfect solution for professionals who need to balance work, family, and career building.
More than 6000 certificates already issued!
Get Your Certificate »
|
The HTML Certificate documents your knowledge of HTML, XHTML, and CSS.
The JavaScript Certificate documents your knowledge of JavaScript and HTML DOM.
The XML Certificate documents your knowledge of XML, XML DOM and XSLT.
The ASP Certificate documents your knowledge of ASP, SQL, and ADO.
The PHP Certificate documents your knowledge of PHP and SQL (MySQL).
|