dom - Get particular child node class name javascript -


i want particular child node(i.e. want div). how can this. code

<html> <head>  </head> <body>     <div id="test">         <input type="text">         <div class="nod1"></div>         <input type="text">         <div class="nod2"></div>     </div> </body>     <script>     var tst=document.getelementbyid('test');     var childrens=tst.children;     for(var i=0; i<childrens.length; i++){         console.log(childrens[i]);     }     </script> </html> 

try this

for(var i=0; i<childrens.length; i++){     console.log(childrens[i].classname); } 

Comments

Popular posts from this blog

php - cannot display multiple markers in google maps v3 from traceroute result -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -