get all the child of the same class javascript

Solutions on MaxInterview for get all the child of the same class javascript by the best coders in the world

we are a community of more than 2 million smartest coders
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
pinned-register now
showing results for - "get all the child of the same class javascript"
Jesús
10 Jun 2016
1var doc = document.getElementById("test");
2var notes = null;
3for (var i = 0; i < doc.childNodes.length; i++) {
4    if (doc.childNodes[i].className == "4") {
5      notes = doc.childNodes[i];
6      break;
7    }        
8}