the code i finally used was: $("ul.glossymenu li").click( function(){ $("ul.glossymenu li").removeClass("current"); $(this).addClass("current");} );
thanks for the help; kd On Apr 11, 9:54 am, victorg <vr.gerrit...@gmail.com> wrote: > Oops, forgot the case on removeClass and addClass: > > $("ul.glossymenu li").bind("onclick",function(){ > $("ul.glossymenu li").removeClass('current'); > $(this).addClass('current'); > }; > ); > > On Apr 11, 3:50 pm, victorg <vr.gerrit...@gmail.com> wrote: > > > The problem is that you are selecting li items which have the class > > glossymenu (li.glossymenu). > > > While you actually need :ul.glossymenu li". > > > So something like this should work :) > > > $("ul.glossymenu li").bind("onclick",function(){ > > $("ul.glossymenu li").removeclass('current'); > > $(this).addclass('current'); > > }; > > ); > > > On Apr 11, 3:03 pm, kevind <kevint...@gmail.com> wrote: > > > > i'm using Glossymenu at dynamic drive: > > > >http://www.dynamicdrive.com/style/csslibrary/item/glossy_horizontal_m... > > > > what i want to accomplish is when I click one of the links inside the > > > LI element, the LI's in the UL lose their class of 'current' and the > > > clicked LI gains the class 'current' > > > > i have the menu driving links to open content in an iframe so, i'm not > > > going to reload the menu each time i choose a different tab - this is > > > why i wish to use jquery. > > > > can someone correct my syntax - i can't seem to get it to work > > > > $("li.glossymenu").bind("onclick",function(){ > > > $("li.glossymenu").removeclass('current'); > > > $(this).addclass('current'); > > > }; > > > ); > > > > thanks