在下拉列表中选择多个选项
- <html>
- <head>
- <script type="text/javascript">
- function selectMultiple()
- {
- document.getElementById("mySelect").multiple=true
- }
- </script>
- </head>
- <body>
- <form>
- <select id="mySelect" size="4">
- <option>苹果</option>
- <option>桃子</option>
- <option>香蕉</option>
- <option>桔子</option>
- </select>
- <input type="button" onclick="selectMultiple()" value="选择多个">
- </form>
- <p>在您点击 “选择多个” 按钮之前,请尝试同时选取多个选项。在点击 “选择多个” 按钮之后,请再试一次。</p>
- </body>
- </html>