简单教程
提交运行
代码编辑器:
<script> function displayResult(){ document.getElementById("mySelect").multiple=true; } </script> <form> <select id="mySelect" size="4"> <option>Apple</option> <option>Pear</option> <option>Banana</option> <option>Orange</option> </select> </form> <button type="button" onclick="displayResult()">允许多个选择</button> <p>按下Ctrl键来选择多个选项</p>
运行结果: