toggleClass confusion

toggleClass confusion

I'm probably just being really thick but i'm confused about this... click

specifically:

  1. $('#foo').toggleClass(className, addOrRemove);

I basically want it so that when my <div class="unselected"> is clicked, it becomes 'selected'. and vice versa

what i have is:

  1. $(document).ready(function () {
    $('#mydiv').click(function () {
  2. $('#mydiv').toggleClass('selected');
  3. });
  4. });

That adds and removes 'selected' from the DIV but i want it to switch between 'unselected' and 'selected'...

Thanks for any help,

Max