JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://rawgit.com/ehynds/jquery-ui-multiselect-widget/master/src/jquery.multiselect.js"></script>
<link rel="stylesheet" href="https://rawgit.com/ehynds/jquery-ui-multiselect-widget/master/jquery.multiselect.css">
<script src="https://rawgit.com/ehynds/jquery-ui-multiselect-widget/master/src/jquery.multiselect.filter.js"></script>
<select id="resourceviewstop">
</select>
<div style="float:left; width:325px">
<h3 style="margin-top:0">Add an item:</h3>
<p>Type in the text of a new option tag to add dynamically.</p>
<input type="text" id="newItem" />
<input type="button" id="add" value="Add" />
</div>
JavaScript
//Drop Down Element
var el = $('#resourceviewstop').multiselect({
header: false,
includeSelectAllOption: true
});
var newItem = $('#newItem');
var opt = opt = $('<option />');
$("#add").click(function () {
var v = newItem.val(),
opt = $('<option />', {
value: v,
text: v
});
additemtomultiselect(el, v, v)
});
function additemtomultiselect(el, id, valuetext) {
var opt = $('<option />', {
value: id,
text: valuetext
});
opt.appendTo(el);
el.multiselect('refresh');
}