[jQuery] Re: test if element as a class

2007-04-27 Thread Michael Price
Alexandre Plennevaux wrote: hello, i'm trying to test a condition whether a link has a given class, and have it return true or false. if ($(this).attr(class)=='refresh') { alert(changing page); return true; } else { return false; } Try, from memory: if ($(this).is(.CLASSNAME))

[jQuery] Re: test if element as a class

2007-04-27 Thread pixeline
hi Michael, i just did : if ($(this).filter(.selected)) { return true; } else { and it worked ! On Apr 27, 10:44 am, Michael Price [EMAIL PROTECTED] wrote: Alexandre Plennevaux wrote: hello, i'm trying to test

[jQuery] Re: test if element as a class

2007-04-27 Thread Dave Cardwell
pixeline wrote: hi Michael, i just did : if ($(this).filter(.selected)) { return true; } else { and it worked ! That's not quite right. .filter() returns a jQuery object, which will always evaluate to true. To