Is there a way to count children only inside element using jQueru or just 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 one counts elements even outside of tag even and scripts or styles!
So Is there a way to count elements only inside body tag?
To get the number of elements only inside the body tag, try