I have a main div in my page with a specific id. Now some input elements of the same class are present in this div. So how can I count the number o
id
div
Simplest example:
document.getElementById("demo").innerHTML = "count: " + document.querySelectorAll('.test').length;
Coffee Milk Soda