How to hide or remove options from jQuery Chosen select dropdown

前端 未结 5 1213
野性不改
野性不改 2021-01-11 19:56

I would like to hide certain elements from a dropdown that is created using the Chosen plugin.

I have tried removing it:

$( \'option:contains(\"Swatc         


        
5条回答
  •  走了就别回头了
    2021-01-11 20:24

    hide the option and update....

    $('#button').click(function(){
            $('select#theIDselect > option[value="Swatch 1"]').hide();
            $('#theIDselect').trigger("chosen:updated");
        });
    

提交回复
热议问题