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?
In code like this it does not working! It counts script to!
– user2311265 Dec 01 '14 at 23:37