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

This example show you how to:

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

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