How can I reset a form with jQuery chosen plugin?

后端 未结 10 1307
甜味超标
甜味超标 2020-12-04 15:12

I have a bunch of select elements in a form with which I am using the Jquery Chosen plugin. How can I reset the form? The following does not work:



        
10条回答
  •  抹茶落季
    2020-12-04 15:36

    None of the previous options work for me. I had to do it like the old school, even using some native javascript, here is the code:

    $('#dllSample option').each(function(){
         $(this)[0].selected = false;   
    });
    $("#dllSample").trigger("chosen:updated");
    

提交回复
热议问题