Element.children
While querySelector()
and querySelectorAll()
search through all levels within a nested DOM/HTML structure, you may want to just get immediate descendant elements of a particular element. Use the .children
property for this.
var elem = document.querySelector('#some-elem');
var descendants = wrapper.children;