Select name Property
Select Object
Definition and Usage
The name property sets or returns the name of a dropdown
list.
Syntax
Set the name property:
Return the name property:
Browser Support

The name property is supported in all major browsers.
Example
Example
Display the name of a dropdown list:
<html>
<head>
<script>
function displayResult()
{
alert(document.getElementById("mySelect").name);
}
</script>
</head>
<body>
<form>
<select name="mySelect" id="mySelect">
<option>Apple</option>
<option>Pear</option>
<option>Banana</option>
<option>Orange</option>
</select>
</form>
<button type="button" onclick="displayResult()">Display name</button>
</body>
</html>
Try it yourself »
Select Object
Thank You For Helping Us!
Your message has been sent to W3Schools.
Close [X]