Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML input name attribute

HTML name attribute

HTML input Tag Reference HTML tag

Example

An HTML form with three input fields, two text fields and one submit button:

Name:

Email:

Try it »


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the name attribute.


Definition and Usage

The name attribute specifies The name of the element.

The name attribute is used to reference the element in JavaScript, or to reference the form data after the form is submitted.

**Note:** Only form elements with a name attribute set can pass their values when the form is submitted.


Differences between HTML 4.01 and HTML5

none.


Syntax

Attribute values

Value Description
text Specifies the The name of the element.

HTML input Tag Reference HTML tag