title: jQuery Multi Select Option - Check if a option is selected or not
body: <p>I have a HTML Multi select box</p>
  
  <pre><code>&lt;form action="form_action.php" method="Post"&gt;
  &lt;select name="cars[]" multiple id="select_id"&gt;
      &lt;option value="all" id="option_id"&gt;All&lt;/option&gt;
      &lt;option value="volvo"&gt;Volvo&lt;/option&gt;
      &lt;option value="saab"&gt;Saab&lt;/option&gt;
      &lt;option value="opel"&gt;Opel&lt;/option&gt;
      &lt;option value="audi"&gt;Audi&lt;/option&gt;
  &lt;/select&gt;
  &lt;input type="submit"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>What I am trying to do is check if option "All" is selected or not in jQuery.</p>
  
  <p>What I have tried is </p>
  
  <pre><code>&lt;script&gt;
          $(document).ready(function()
          {
              $('#option_id')
                  .click(
                      function()
                      {
                          if ($("#select_id option[value='all']").length == 0) { //value does not exist so add
                              //Do something if not selected
                          }
                          else
                          {
                              //DO something if selected
                          }
                          //$("#select_id option:selected").removeAttr("selected");           //Remove
                          //$("#select_id option").attr('selected', 'selected');      //Add
                      }
                  );
          });
      &lt;/script&gt;
  </code></pre>
  
  <p>But it is not working.</p>
  
  <p>Can anyone help me please?</p>
  
  <p>Thanks in advance for helping.</p>