开发者

once you select an item on a multiselect html listbox, is there anyway to deselect all

开发者 https://www.devze.com 2023-01-19 08:16 出处:网络
My users can\'t seem to deselect all on a select in html.I have a basic multiselect listbox in html: <select class=\"longDropdown\" id=\"SelectedCalendars\"

My users can't seem to deselect all on a select in html. I have a basic multiselect listbox in html:

 <select class="longDropdown" id="SelectedCalendars"
         multiple="multiple" name="SelectedCalendars">
     <option value="13">ER</option>
     <option selected="selected" value="26">Billy 123</option>
     <option selected="selected" value="28">New Cal</option>
 </select>

if a few items start out selected, you can change by 开发者_如何学JAVAclicking on others to remove the selection, but there doesn't seem to be a way for a user to deselect them all. do i really have to write some jquery / javascript code to do this programatically. Is this a flaw in the HTML UI spec?


On macOS, the user can + click on the last selected item to deselect it. On other platforms, the user would use Ctrl + click instead.

0

精彩评论

暂无评论...
验证码 换一张
取 消