How can I disable selected attribute from select2() dropdown Jquery?

Attila Naghi picture Attila Naghi · Jan 17, 2014 · Viewed 108.1k times · Source

I know how to enable the selected attribute from dropdown; I can use this code :

$('select').select2();

but my problem is how to disable it ? thx Click Here

Answer

user4105545 picture user4105545 · Oct 3, 2014

The right way for Select2 3.x is:

$('select').select2("enable", false)

This works fine.