title: How to append new options by removing the existing options on change from multiselect dropdown?
body: <p>I get the options from ajax as shown below. This dropdown is dependent on another dropdown>. The below example is only to append options on onload and it does the job. However, in the second example, when I try to change the options on change when other option is selected, it is just keep appending options rather than removing the existing ones. How to generate new options by deleted the existing ones based on selected value? </p>
  
  <pre><code>enter code here
  
  //First Example 
       openPage: function () {
                  $.ajax({
                      type: "GET",
                      dataType: "json",
                      url: _config.GetCampaignsByMarket,
                      data: {
                          marketValue: $('#market-select').val()
                      },
                      //contentType: 'application/json',
                      success: function (data) {
                          var items = '';
                          $.each(data, function (key, val) {
  
                              $('.select-ajax').append('&lt;option selected value="' + val.CampaignInitiative + '"&gt;' + val.CampaignInitiative + '&lt;/option&gt;');
                            //items += "&lt;option value='" + val.CampaignInitiative + "'&gt;" + val.CampaignInitiative + "&lt;/option&gt;";
  
                          });
  
  
                       $('.select-ajax').multiselect('rebuild');
  
  
  
                      },
                      error: function (xhr, status, error) {
  
                      }
                  });
              }
  </code></pre>
  
  <p>//Second Example </p>
  
  <p>initSelect: function () {
              var data = {};</p>
  
  <pre><code>        $('#market-select').change(function () {
              //$('#campaign-select').empty();
              var selected = $(this).val(); // get current dropdown element selected value
              $.ajax({
  
                  type: "GET",
                  dataType: "json",
                  url: _config.GetCampaignsByMarket,
                  data: { marketValue: $('#market-select').val() },
                  success: function (data) {
                      var items = '';
                      $.each(data, function (key, val) {
                          // items += "&lt;option value='" + val.CampaignInitiative + "'&gt;" + val.CampaignInitiative + "&lt;/option&gt;";
                          $('.select-ajax').append('&lt;option selected value="' + val.CampaignInitiative + '"&gt;' + val.CampaignInitiative + '&lt;/option&gt;');
  
                      });
  
  
                      $('.select-ajax').multiselect('rebuild');
                      $('.select-ajax').multiselect('updateButtonText', false);
  
  
                  },
  
  
              });
          })
      }
  </code></pre>