count - jQuery inside body tag only? -
is there way count children inside element using jqueru or javascript?
i tried several methods like:
var count = $(document.body).children().length or var count = 0; $(document.body).children().each(function(){ count +=1 });
and every single 1 counts elements outside of tag , scripts or styles!
so there way count elements inside body tag?
to number of elements inside body tag, try
var btags = document.body.getelementsbytagname("*"); var count = btags.length;
Comments
Post a Comment