looping through select tag jquery
<p>trying to create a loop through a select tag, with multiselect. I'm new to jquery and i found this code, however i need to loop through all checking whether the option is selected or not, as i need to do something in both cases.</p>

<pre><code>$(".multiselect").change(function () {
      $(".multiselect option:selected").each(function () {
        //do something
          });
    }).trigger('change');
</code></pre>

<p>I was trying to make it into something more like</p>

<pre><code>$(".multiselect").change(function () {
      $(".multiselect").each(function () {
       $('option', this).each(function() {
     if ('option':selected == true) {
             //do something}
             else {//do something else}
       });
      });
    }).trigger('change');
</code></pre>

<p>but it doesn't work. Can someone suggest a good approach?</p>
