title: Using onChange in bootstrap multiselect
body: <p>I'm trying to use bootstrap multiselect to set the visibility of some columns in a table via the jQuery <code>toggle()</code> function. For each column chosen in the dropdown I want to either show or hide it depending on it being selected or not.
  But I clearly do not understand how to use the <code>onChange</code> event to make this work.
  Would someone please show me the correct syntax.</p>
  
  <p>My javascript and HTML is as follows:</p>
  
  <pre><code>  &lt;script type="text/javascript"&gt;
      $(document).ready(function() {
          $('#showops').multiselect({
              maxHeight: 300,
              buttonWidth: '150px',
              includeSelectAllOption: true,
              allSelectedText: 'Showing All',
              onChange: function(element, checked) {
                  if(checked == true){
                      if (element == '1') { $(".toggleG").toggle(); }
                      else if (element == '2') { $(".toggleE").toggle(); }
                  }
              }
          });
      });
  &lt;/script&gt;
  
  &lt;select id="showops" multiple="multiple"&gt;
      &lt;option value="1"&gt; Show Grid &lt;/option&gt;
      &lt;option value="2"&gt; Show eMail &lt;/option&gt;
      &lt;option value="3"&gt; Show Lat/Lon &lt;/option&gt;
      &lt;option value="4"&gt; Show Last Name &lt;/option&gt;
      &lt;option value="5"&gt; Show TOD &lt;/option&gt;
   &lt;/select&gt;
  </code></pre>