toggleClass() takes a class name as argument, not a selector. $(document).ready(function() { $("a").filter("#click").click(function(){ $("div .six").toggleClass("two"); }).end() });
On Jan 6, 10:20 pm, amuhlou <amysch...@gmail.com> wrote: > In your script it appears that you are trying to toggle the class of a > div, but in the HTML you have no divs. > > On Jan 6, 11:19 am, "thiago silvestre" <thisilver....@gmail.com> > wrote: > > > Hello, > > > I'm a beginner with jQuery. My function is not working. > > * > > jQuery:** > > * > > $(document).ready(function() { > > $("a").filter("#click").click(function(){ > > $("div .six").toggleClass("div .two") > > }).end() > > }); > > > *HTML* > > > <ul> > > <li class="six"><a href="#" id="click">Click</a></li> > > </ul> > > > Help-me plz. > > Tks :))) > > > -- > > Thiago Silvestre > > Web / Design / Illustration > > Portfolio:http://www.thisilver.com > > Msn/Gtalk: thisilver....@gmail.com