简单教程
提交运行
代码编辑器:
<script> function displayResult(){ alert(document.getElementById("mySelect").type); } </script> <form> <select id="mySelect"> <option>Apple</option> <option>Pear</option> <option>Banana</option> <option>Orange</option> </select> </form> <button type="button" onclick="displayResult()">显示下拉列表的类型</button>
运行结果: