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

前端 未结 10 1863
北海茫月
北海茫月 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:13

    Better than this, you can use:

    $("#selectID").empty();
    

    That works on almost anything in the DOM.

提交回复
热议问题