Newbie : Trying to use the ToggleClass

Newbie : Trying to use the ToggleClass

I'm trying to toggle the on and off class on list items but having issues it working.

I only want the 'on' class on the element that is clicked. So if another element in the list is clicked it removes the 'on' class from the one that had it to the one that has been clicked.

Any advice?

Thanks

  1. $(document).ready(function(){
  2.    $("#oVideoPlayerBreadcrumbs li a").click(function(e){
  3.    $('#oVideoPlayerBreadcrumbs > ul').find('li').filter('[class=on]').toggleClass('off');
  4.   $(this).toggleClass('on');
  5.   e.preventDefault();
  6.    });
  7. });

  8.        <div id="oVideoPlayerBreadcrumbs">
                        <ul>
                            <li><a href="return false;" class="on" id="v1">1</a></li>
                            <li><a href="return false;" class="off" id="v2">2</a></li>
                            <li><a href="return false;" class="off" id="v3">3</a></li>
                            <li><a href="return false;" class="off" id="v4">4</a></li>
                            <li><a href="return false;" class="off" id="v5">5</a></li>
                            <li><a href="return false;" class="off" id="v6">6</a></li>
                            <li><a href="return false;" class="off" id="v7">7</a></li>
                            <li><a href="return false;" class="off" id="v8">8</a></li>
                            <li><a href="return false;" class="off" id="v9">9</a></li>
                        </ul>
                    </div>