English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The name attribute specifies the name of the <input> element, which is used to reference the element in JavaScript or to reference form data after submitting the form.
An HTML form with three input fields; two text fields and a submit button:
<!DOCTYPE html> <html> <head> <title>HTML: <input> name attribute - basic tutorial website(oldtoolbag.com)</title> <body> <form action="action_page.php"> Name: <input type="text" name="fullname"><br> Email: <input type="text" name="email"><br> <input type="submit" value="Submit"> </form> </html>Test it out ‹/›
IEFirefoxOperaChromeSafari
All major browsers support the name attribute.
The name attribute specifies the name of the <input> element.
The name attribute is used to reference elements in JavaScript or to reference form data after the form is submitted.
Note: Only form elements with the name attribute will pass their values when the form is submitted.
None.
<input name="text">
Value | Description |
---|---|
text | Specify the name of the <input> element. |