English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML Reference Manual

Complete List of HTML Tags

HTML select name attribute

The name attribute specifies the name of the dropdown list, and it is used to reference elements in JavaScript or to reference form data after submitting the form.

 HTML <select> tag

Online Example

Dropdown list with name attribute:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>HTML select name attribute usage-Basic Tutorial(oldtoolbag.com)</title>
</head>
<body>
<form action="action_page.php">
<select name="lan">
  <option value="PHP">PHP</option>
  <option value="Python">Python</option>
  <option value="C#">C#</option>
  <option value="Golang">Golang</option>
</select>
<input type="submit">
</form>
</body>
</html>
Test it out ‹/›

Browser Compatibility

IEFirefoxOperaChromeSafari

All major browsers support the name attribute.

Definition and Usage

The name attribute specifies the name of the dropdown list.

The name attribute is used to reference elements in JavaScript, or to reference form data after form submission.

HTML 4.01 and HTML5differences between

None.

Syntax

<select name="text">

Attribute value

ValueDescription
textName of the dropdown list.
 HTML <select> tag