I want to loop through all the elements in the DOM structure of a html page with jQuery.
Basically only the elements within the body tags are needed.
The reason I want to do this is because I want to fetch the positions of every element
in the body structure.
I googled around and I found no answer to my question.
Your help is much appreciated.
If you have inline
<script>tags and the like, you can add a:notselector to exclude those:As pointed out in the comments and the jQuery all selector docs, this probably won’t perform very well. I haven’t done any empirical testing, but this might perform better: