JSFiddle - React, Tailwind, and code Playground
HTML
<link rel="stylesheet" href="http://ivaynberg.github.io/select2/select2-3.3.2/select2.css">
<script src="http://ivaynberg.github.io/select2/select2-3.3.2/select2.js"></script>
<select id="sel" data-placeholder="This is my placeholder">
<option></option>
<option value="a">hello</option>
<option value="b">all</option>
<option value="c">stack</option>
<option value="c">overflow</option>
</select>
<br>
<button id="pres">Disable and clear</button>
<button id="ena">Enable</button>
CSS
#sel {
margin: 20px;
}
JavaScript
$(document).ready(function () {
$("#sel").select2();
$("#pres").click(function () {
$('.select2-container > a > span').text('This is my placeholder');
$("#sel").empty().select2("disable");;
});
$("#ena").click(function () {
$("#sel").select2("enable");
});
});