How to clear all selected items in a SELECT input using jQuery?

前端 未结 10 1867
北海茫月
北海茫月 2020-12-28 13:55

I am think this should be fairly easy, but struggling a bit ... I have a SELECT input element that allows the user to select multiple items. I would like to pro

10条回答
  •  情歌与酒
    2020-12-28 14:38

    Try this

    
    
    
    $(document).ready(function() {  
       $('#remove').click(function() {  
         return $('#select1 option:selected').remove(); 
       });
     });
    

提交回复
热议问题