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

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

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -