'select all' and 'remove all' with chosen.js

前端 未结 7 1706
深忆病人
深忆病人 2020-12-24 12:29

For the select menu plugin chosen.js, is there an established way to add \'select all items in list\' or \'remove all items in list\' feature to a multiple select input? In

7条回答
  •  臣服心动
    2020-12-24 13:06

    Just straight forward way of clearing selection:

    $('select').val('');
    $('select').val('').trigger("chosen:updated"); 
    

提交回复
热议问题