[jQuery] Re: Counting DIVs with class "x" within a larger DIV

2008-02-12 Thread Karl Rudd
For all children (including grandchildren): $('#data .x').length For just children: $('#data > .x').length Karl Rudd On Feb 13, 2008 9:07 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Hi, > > Sure this is simple, still trying to get a handle on the basics of > JQuery. Given a

[jQuery] Re: Counting DIVs with class "x" within a larger DIV

2008-02-12 Thread Erik Beeson
Untested, but should work: $('#data .x').length --Erik On 2/12/08, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > Hi, > > Sure this is simple, still trying to get a handle on the basics of > JQuery. Given a DIV with id = "data", how would I count the number of > DIVs with class = "x", withi