It should. I just typed this into my Firebug console on a page including
jQuery:

$('body').append('<div id="test"></div>');

$('#test').append('<p>'+ $('#test').children().size()  +'</p>');

$('#test').append('<p>'+ $('#test').children().size()  +'</p>');

$('#test').append('<p>'+ $('#test').children().size()  +'</p>');

Seemed to work as expected....

Scott

On 10/3/07, wattaka <[EMAIL PROTECTED]> wrote:
>
>
> Thanks Wizzud, but this does not work with elements that are
> dynamically added to the DOM, is there another way? Thanks
>
> On Oct 3, 11:26 pm, Wizzud <[EMAIL PROTECTED]> wrote:
> > var ct = $('div').children().size();
> >
> > wattaka wrote:
> >
> > > How can I count the number of child elements that a div container has?
> > > Thanks
> >
> > --
> > View this message in context:
> http://www.nabble.com/Counting-the-number-of-child-elements-that-a-di...
> > Sent from the jQuery General Discussion mailing list archive at
> Nabble.com.
>
>


-- 
--
Scott Trudeau
scott.trudeau AT gmail DOT com
http://sstrudeau.com/
AIM: sodthestreets

Reply via email to