I\'m using jQuery select2 multi select dropdown. I need to select all options in a dropdown from code.
Basically there is a Select All checkbox on which this functionality h
// Select all
$('#select-id').select2('destroy').find('option').prop('selected', 'selected').end().select2();
// Unselect all
$('#select-id').select2('destroy').find('option').prop('selected', false).end().select2();