[jQuery] Re: how to get one class from a multi-class element?

2009-01-24 Thread Ramanathan RV
It depends on what class you want to use. target = $(div).attr(class).split( ) Now if I know what class I want to use, I would choose that one. But since thats not the probable case, lets say $.each(target, function(cls) { $(p).filter(. + cls).doSomething();}); Probably that helps. If that

[jQuery] Re: how to get one class from a multi-class element?

2009-01-24 Thread donb
$(p).hasClass(tiny).each( function(i) { ...do something .. } ); On Jan 24, 4:13 pm, cherry.aus...@gmail.com cherry.aus...@gmail.com wrote: I'm getting all knotted up on this! I'm looking to use one class, from an element with several, as a selector. Example: div class=red tiny bold

[jQuery] Re: how to get one class from a multi-class element?

2009-01-24 Thread cherry.aus...@gmail.com
Thanks for your perception, donb ;) And thank you, Ram, that's exactly what I needed! Cherry On Jan 24, 11:15 pm, donb falconwatc...@comcast.net wrote: $(p).hasClass(tiny).each(   function(i) {   ...do something ..   } ); On Jan 24, 4:13 pm, cherry.aus...@gmail.com