Friday, May 10, 2024
58
rated 0 times [  62] [ 4]  / answers: 1 / hits: 103625  / 11 Years ago, fri, october 11, 2013, 12:00:00

Say we have a simple select2 list:



<select id=e1>
<option value=AL>Alabama</option>
...
<option value=WY>Wyoming</option>
</select>


Initiated like:



$(#e1).select2();


How can I remove select2 and return it to a regular dropdown? I can't find any examples or entry in documentation.



Something like:



$(#e1).select2('remove'); 


would be nice.


More From » jquery-select2

 Answers
39

You need to use destroy method on select2. See the Documentation



i.e



 $(#e1).select2('destroy'); 

[#75046] Friday, October 11, 2013, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
mckenna

Total Points: 445
Total Questions: 109
Total Answers: 109

Location: Virgin Islands (U.S.)
Member since Sun, May 16, 2021
3 Years ago
;