How to count every element including head body in the document in jQuery ?
In this article, we will count every element (including head, body, etc) in the document using jQuery. To count all HTML elements, we use length property. The length property is used to count number of the elements of the jQuery object.
where selector is the object whose length is to be calculated.
Before Click Button:
After Click Button:
Attention reader! Don’t stop learning now. Get hold of all the important HTML concepts with the Web Design for Beginners | HTML course.