Advertisement
Home Open Editor ❯

HTML <select> name Attribute

Example

<label for="lang">Choose your option:</label>

<select name="language" id="lang">
  <option value="HTML">HTML</option>
  <option value="CSS">CSS</option>
  <option value="JavaScript">JavaScript</option>
</select>

Try this code ❯

Meaning

The name attribute allows a form control to be assigned a name for defining the name/value pair used in form submission.

These values were used by scripting languages or reference form data after a form is submitted, though the standards encourage the use of the id attribute. For compatibility purposes, both might have to be used.


Standard Syntax

<select name="uniqueName">
  <option>text</option>
</select>


Advertisement

Attribute Values

Value Description
uniqueName Which represents the element’s name.
Home Open Editor ❯
Advertisement