Latest web development tutorials

HTML input name attribute

HTML input Tag Reference HTML <input> tag

Examples

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

<form action="demo_form.php">
Name: <input type="text" name="fullname"><br>
Email: <input type="text" name="email"><br>
<input type="submit" value="提交">
</form>

try it"

Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support name attribute.


Definition and Usage

name attribute specifies the <input> element's name.

name attribute is used to reference elements in JavaScript, or a reference in the form submission form data.

Note: Only set the form element name attribute to pass their values when the form is submitted.


Differences between HTML 4.01 and HTML5

no.


grammar

<input name="text">

Property Value

描述
text 规定 <input> 元素的名称。


HTML input Tag Reference HTML <input> tag