jquery-select2select-options

clear all select2 options


I can't find on select2 documentation a way to remove all the options in a select2 form. The old stckoverflow answers to this questions seem not to work since the new version (I'm using 4.0.3) has a different behavior


Solution

  • Just

    $('#id').empty().trigger("change");

    Where '#id' is the jQuery selector for your select2 element.