HTML Input name Attribute

Definition and Usage

The name attribute is used to identify form data after it has been submitted.
Unlike the unique id attribute, some input types share the same name attribute (mostly used with the type="radio" input).
This attribute is required with all input types, except type="reset" and type="submit".
Only elements with the name attribute specified will have their values sent by the form element.


<input name="name/id" />

Syntax Example

<input name="demo" />

Attribute Values

Value Description
name/id Specifies the name of the input element.Naming rules:
  • Must begin with a letter A-Z or a-z
  • Can be followed by: letters (A-Za-z), digits (0-9), hyphens ("-"), underscores ("_"), colons (":"), and periods (".")
  • Values are case-sensitive

Browser Support

The attribute is supported in all major browsers.


<form action="">
<input type="text" name="demo" />
HTML Input name Attribute Reviewed by 1000sourcecodes on 04:06 Rating: 5
Powered by Blogger.