Quick way to clear all selections on a multiselect enabled <select> with jQuery?

后端 未结 13 2797
半阙折子戏
半阙折子戏 2020-12-09 07:52

Do I have to iterate through ALL the and set remove the \'selected\' attribute or is there a better way?

13条回答
  •  旧巷少年郎
    2020-12-09 07:56

    In order to clear all selection, I am using like this and its working fine for me. here is the script:

     $("#ddlMultiselect").multiselect("clearSelection");
    
     $("#ddlMultiselect").multiselect( 'refresh' );
    

提交回复
热议问题