Bootstrap-Multiselect: How to uncheck and deselect Multiselect options using JQuery
<p>I want to write JQuery code that will uncheck and deselect some options from Bootstrap  Multi select.</p>

<p>For example if the multi-select is has following values selected &amp; checked:
<a href="https://i.stack.imgur.com/wb9Sd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wb9Sd.png" alt="enter image description here"></a></p>

<p>I want a JQuery that will output the following </p>

<p><a href="https://i.stack.imgur.com/cYQIF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cYQIF.png" alt="enter image description here"></a></p>

<p>I did the following JQuery which didn't work:</p>

<pre><code>    $('#example-optionClass').val('1').prop('checked', flase);
    $('#example-optionClass').val('4').prop('checked', flase);
    $('#example-optionClass').val('2').prop('checked', true);
    $('#example-optionClass').val('6').prop('checked', true);
</code></pre>

<p>Here the the Source code:</p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
&lt;html lang="en"&gt;
&lt;head&gt;
  &lt;title&gt;Bootstrap Example&lt;/title&gt;
  &lt;meta charset="utf-8"&gt;
  &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt;
  &lt;link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"&gt;
  &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"&gt;&lt;/script&gt;
  &lt;!-- Include the plugin's CSS and JS: --&gt;
&lt;script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-multiselect/0.9.13/js/bootstrap-multiselect.js"&gt;&lt;/script&gt;
&lt;link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-multiselect/0.9.13/css/bootstrap-multiselect.css" type="text/css"/&gt;
&lt;script type="text/javascript"&gt;
    $(document).ready(function() {
        $('#example-optionClass').multiselect({
            includeSelectAllOption: true, // add select all option as usual
            optionClass: function(element) {
                var value = $(element).val();
 
                if (value%2 == 0) {
                    return 'odd'; // reversed
                }
                else {
                    return 'even'; // reversed
                }
            }
        });
    });
&lt;/script&gt;
&lt;style type="text/css"&gt;
    #example-optionClass-container .multiselect-container li.odd {
        background: #eeeeee;
    }
    #example-optionClass-container .multiselect-all {
       background: #eeeeee;
    }
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;

&lt;div class="container"&gt;
  &lt;h2&gt;Bootstrap Multiselect Test&lt;/h2&gt;  
  &lt;div id="example-optionClass-container"&gt;
    &lt;select id="example-optionClass" multiple="multiple"&gt;
        &lt;option value="1"&gt;Option 1&lt;/option&gt;
        &lt;option value="2"&gt;Option 2&lt;/option&gt;
        &lt;option value="3"&gt;Option 3&lt;/option&gt;
        &lt;option value="4"&gt;Option 4&lt;/option&gt;
        &lt;option value="5"&gt;Option 5&lt;/option&gt;
        &lt;option value="6"&gt;Option 6&lt;/option&gt;
    &lt;/select&gt;
&lt;/div&gt;
&lt;/div&gt;


&lt;/body&gt;
&lt;/html&gt;</code></pre>
</div>
</div>
</p>

<p>Please help.thanks</p>