title: jquery ajax Display multiple pages in div from multiple selection drop-down form
body: <p>I have a multi select drop down. I need a div to be filled with pages based on the selections. I have this working for one selection at a time. I need it to also work when I select more than one option the corresponding pages will populate the div. </p>
  
  <p>For exemple... if I select Item1 and Item2. I want the pages item1.php and item2.php displayed in my div. If I then delete item1 from the selection (using chosen.js) I need only item2.php to show since that is the only current selection.</p>
  
  <p>Here is my current code:</p>
  
  <pre><code> $('#maindiv').on('change', function(event) {
        var selected = $(this).val();
  
        $.ajax({
              url: 'includes/'+ selected + '.php',
              type: 'POST',
              data: { cat: selected },
  
          })
          .done(function(data) {
              $('#displaydiv').html(data)
          })
          .fail(function() {
              console.log("error");
          })
          .always(function() {
              console.log("complete");
          });
  
    });
  </code></pre>