you have a syntax error $("p:not(.open)").click(function() { // Do something $(this).addClass("open"); });
On Jul 18, 11:02 am, Daniele <[EMAIL PROTECTED]> wrote: > Hi. I am doing a simple thing summarized as follow: when i click on a > paragraph i want it to do something only the first time. > > I was able to do it using "one( type, data, fn )" but before that I > tried using a different approach like this: > > $("p:not(.open)").click(function () { > // do something ... > $(this).addClass("open"); > )}; > > or > > $("p").not(".open").click(function () { > // do something ... > $(this).addClass("open"); > )}; > > I know I am missing some basics here but I'm out of ideas. > > Oh and not spending another post for it, is there someone who can > explain me what's the differences (not using bind, function and > handler words :-) ...) between: > > $("p").click(function () { ... > > and > > $("p").bind("click", function() { ... > > thanks in advance. > > d.