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

前端 未结 21 762
一个人的身影
一个人的身影 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:34

    The new Chosen libraries don't use the liszt. I used the following:

    document.getElementById('autoship_option').selectedIndex = 0;
    $("#autoship_option").trigger("chosen:updated");
    

提交回复
热议问题