How can I make an HTML multiple select act like the control button is held down always

前端 未结 4 1580
慢半拍i
慢半拍i 2020-12-17 15:47

I have a web application I\'m working on that requires a HTML multiple select element operates like the control key is held down at all times. I.e. click on an option will

4条回答
  •  不知归路
    2020-12-17 16:18

    You may want to consider a simpler solution, like using a list of checkboxes inside a div whose overflow property is set to scroll. That might work out better for you. Getting a drop down to do what you've asked is a bit involved.

    See this for example:

    label{display:block;}
        #container{height:100px;width:200px;overflow:scroll;}

提交回复
热议问题