<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 of dropdown list</button>
</body>
</html>