运行 ❯
获取您的
自己的
网站
×
更改方向
保存代码
更改主题,暗色/亮色
前往 Spaces
<!DOCTYPE html> <html> <body> <form> <select id="mySelect" size="4"> <option>Apple</option> <option>Pear</option> <option>Banana</option> <option>Orange</option> </select> </form> <p>Click the button to allow multiple selection (meaning that you can select more than one option in the drop-down list).</p> <button type="button" onclick="myFunction()">Try it</button> <p><b>Tip:</b> Hold Ctrl or Shift to select more than one option.</p> <p id="demo"></p> <script> function myFunction() { document.getElementById("mySelect").multiple = true; document.getElementById("demo").innerHTML = "You can now select multiple options."; } </script> </body> </html>