enltr xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/terms/" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:og="http://ogp.me/ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:sioc="http://rdfs.org/sioc/ns#" xmlns:sioct="http://rdfs.org/sioc/types#" xmlns:skos="http://www.w3.org/2004/02/skos/core#" xmlns:xsd="http://www.w3.org/2001/XMLSchema#"http://www.w3.org/1999/xhtml/vocab/////////////////Find and get element within parent with .findAll() | BitsyCodehttps://www.bitsycode.com/methods/dom/findAllFind and get element within parent with .findAll() | BitsyCode Find and get element within parent with .findAll() | BitsyCode html not-front not-logged-in no-sidebars page-node page-node- page-node-51 node-type-page

Find and get element within parent with .findAll()

container

.findAll()


Description: Find and return an array of all child elements found within parent.


Example:

<!doctype html>
    <html lang="en">
    <head>
      <meta charset="utf-8">
      <title>findAll demo</title>
      <script src="http://code.bitsycode.com/bitsycode-latest.min.js"></script>
    </head>
    <body>
      
      <ul>
         <li>Cat</li>
         <li>Dog</li>
         <li>Wolf</li>
         <li>Lion</li>
      </ul>
      
      <div class="results"></div>
      
      <script>
         
         bitsyCode.ready(function(){
            var animals = bitsyCode("ul").findAll("li");
            
            for (var i = 0; i < animals.length; i++) {
                bitsyCode(".result").append(bitsyCode([animals[i]]).text() + "<br />");
            }            
            
         })
         
      </script>
     
    </body>
    </html>

Preview:

Cat
Dog
Wolf
Lion
Share

Developed and built with passion and commitment.
Maintained by the bitsycode team.