How do I reset a jquery-chosen select option with jQuery?

前端 未结 21 733
一个人的身影
一个人的身影 2020-11-30 21:42

I have tried numerous things and nothing seems to be working.

I am using jQuery and Chosen plugin.

Methods I have tried:

var select = jQuery(         


        
21条回答
  •  隐瞒了意图╮
    2020-11-30 22:23

    $('#autoship_option').val('').trigger('liszt:updated');
    

    and set the default option value to ''.

    It has to be used with chosen updated jQuery available at this link: https://raw.github.com/harvesthq/chosen/master/chosen/chosen.jquery.min.js.

    I spent one full day to find out at the end that jquery.min is different from chosen.jquery.min

提交回复
热议问题