HTML <input> name Attribute

❮ HTML <input> tag


<form action="action.php">
  <label for="fname">First name:</label>
  <input type="text" id="fname" name="fname">

  <label for="lname">Last name:</label>
  <input type="text" id="lname" name="lname">

  <input type="submit" value="Submit">


The name attribute allows a form control to be assigned a name to set as the name/value pair value sent to the server.

Standard Syntax

HTML: <input name="text">

XHTML: <input name="text"/>

Browser Support


Attribute Values

Value Description
text Specifies the name/value of the <input> element
❮ HTML <input> tag