Skip to content

Returns an array of all the elements within a dom element, including the dom element itself

License

Notifications You must be signed in to change notification settings

cosmosio/get-nodes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

get nodes

Returns an array of all the elements within a dom element, including the dom element itself.

Installation

npm install get-nodes

How to use

Require get-nodes:

var getNodes = require("get-nodes");

Given this DOM structure:

<header></header>
<section>
    <div></div>
    <div></div>
    <div></div>
</section>
<footer></footer>

To retrieve all the elements in section:

getNodes(document.querySelector("section"));
// [
//    <section>,
//    <div>,
//    <div>,
//    <div>
// ]

LICENSE

MIT

About

Returns an array of all the elements within a dom element, including the dom element itself

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published