Example 22: (Open the Dev Console and check the Log)

This example show you how to:

  • Load the plugin
  • Return the Selected ids when close the mSelect

HTML:
<select id="country_id" class="mSelect" multiple="multiple"></select>
JS:
$(function () {
    $('#country_id').mSelect({
        url: 'ajax/example1.php',
        onDropdownHide: function(selectedIds) { // callback functions
            // do something here..
            console.log('the mSelect is closed');
            console.log(selectedIds);  
        }
    });
});