JSFiddle - React, Tailwind, and code Playground

by bseth99

HTML

<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css">
<script src="http://bseth99.github.io/jquery-ui-extensions/ui/jquery.ui.combobox.js"></script>
<link rel="stylesheet" href="http://bseth99.github.io/jquery-ui-extensions/themes/base/jquery.ui.combobox.css">
<select>
   <option>One</option>
   <option>Two</option>
   <option>Three</option>
</select>
<button class="change">Toggle</button>

JavaScript

$('select').combobox();
$('button.change').click(function() {
    if ( $('select')[0].options.length ) {
        $('select').html('');
    } else {
       $('select').html(
              '<option>One</option>'+
              '<option>Two</option>'+
              '<option>Three</option>'
           );
    }
    $('select').combobox().combobox('value', '');
});