0
Counting elements by class name?
So I was wondering if it's possible to count the number of elements with a certain class name using js.
4 Antworten
+ 5
document.getElementsByClassName() returns an array so the amount of elements is the length of the array,
document.getElementsByClassName("class").length
0
You should get the length of a call of GetElementsByClassName
0
Well, I want to count the number of divs with the class name "entry" and display it on the webpage
0
So dumb question
how do I display it on the webpage