Use drop-down list boxes for multiple selections
The drop-down list can also perform multiple selection operations. Set the multiple="multiple"
attribute in the <select> tag to realize the multi-selection function. Under the Windows operating system, perform When making multiple selections, press the Ctrl
key while simultaneously clicking
(use Command +clicking under Mac ), you can select multiple options. The following code:
<!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>使用下拉列表框進行多選</title> </head> <body> <form> <laber>你覺得我?guī)泦幔?lt;/laber><br /> <select multiple=multiple> <option value="哎呀媽呀,賊帥了!"selected>哎呀媽呀,賊帥了!</option> <option value="最帥!">最帥!</option> <option value="宇宙無敵了!">宇宙無敵了!</option> <option value="無人能比了!">無人能比了!</option> </select> </form> </body> </html>
The results displayed in the browser: