Manivasagan
Manivasagan

Reputation: 212

How do i remove all option from multiselect2side select box?

I used jquery multiselect2side select box. I used below code to add option

$("#myselect").multiselect2side('addOption', {name: opionTitle, value: libraryvalue[i].uri, selected: false});

In the same way, I want to remove all option from select box. I used below jquery script to remove. But it was not working

$("#myselect").empty();

Upvotes: 0

Views: 999

Answers (1)

msapkal
msapkal

Reputation: 8346

After empty you will need to destroy and again initialize the plugin. Hope this works for you.

$('#myselect').empty().multiselect2side('destroy');
$('#myselect').multiselect2side();

Upvotes: 1

Related Questions