title: How to get the value of the currently selected Selectize.js input item
body: <p>I was wondering, how could I get the value of the currently selected item in my Selectize.js input?  I have checked the documentation and scoured everything selectize.js related on Stackoverflow but found nothing in the way of an example I could go off of.  Any ideas?  Here is what I figured would work based on the documentation, but instead gave me <code>Undefined is not a function</code> error.</p>
  
  <p>Please note the very bottom of the code, where I use the <code>select.on('change'</code>; this (in addition to other API methods) is what I have tried.  The on change works perfectly, but unfortunately nothing else has.</p>
  
  <pre><code>var select = $('#searchTextbox').selectize({
            maxItems: 1, //Max items selectable in the textbox
            maxOptions: 30, //Max options to render at once in the dropdown
            searchField: ['text'], //Fields the autocomplete can search through.  Example of another searchable field could be 'value'
            openOnFocus: true,
            highlight: true,
            scrollDuration: 60, //currently does nothing; should say how many MS the dropdown and drop up animations take
            create: false, //Whether or not the user is allowed to create fields
            selectOnTab: true,
            render: {
                option: function(data, escape) {
                    var valueArray = [];         
                    valueArray[0] = data.value.split(",");
                    var color = valueArray[0][0] == "1" ? "green" : "red";
  
                    return '&lt;div class="option" style="color: ' 
                        + color 
                        + ';"&gt;' 
                        + escape(data.text) 
                        + '&lt;/div&gt;';
                },
                item: function(data, escape) {
                    var valueArray = [];         
                    valueArray[0] = data.value.split(",");
                    var color = valueArray[0][0] == "1" ? "green" : "red";
  
                    return '&lt;div class="option" style="color: ' 
                        + color 
                        + ';"&gt;' 
                        + escape(data.text) 
                        + '&lt;/div&gt;';
                }      
            }
        });
  
  select.on('change', function() {
        var test = select.getItem(0);
        alert(test.val());
  });
  </code></pre>
  
  <p></p>