JSFiddle - React, Tailwind, and code Playground

HTML

<script src="http://ivaynberg.github.com/select2/select2-3.2/select2.js"></script>
<link rel="stylesheet" href="http://ivaynberg.github.com/select2/select2-3.2/select2.css">
<input type="hidden" id="foo" style="width: 100px;"/>
<button id="enable">Enable</button>
<button id="disable">Disable</button>
<button id="status">Status</button>
<div id="log"></div>

JavaScript

$(document).ready(function(){
    
    $('#foo').select2({
        data: [{id: 1, text: 'first'}, {id: 2, text: 'second'}]
    });
    $('#enable').click(function(){
        $('#foo').select2('enable');
    });
    $('#disable').click(function(){
        $('#foo').select2('disable');
    });
    $('#status').click(function(){
        $('#log').append('Status:'+$('#foo').prop('disabled')+'<br>');
    });
});