<html>
<head>
<script language="JavaScript1.1">
function getType(){
console.log("The name of this text box is " + document.myForm.elements[0].type);
}
</script>
</head>
<body>
<form name="myForm">
<select name="mySelect">
<option value=A>AA</option>
<option value=B>BB</option>
<option value=C>CC</option>
<option value=D>DD</option>
</select>
<input type=BUTTON value="Get Type" name="myButton" onClick='getType()'>
</form>
</body>
</html>