I\'m generating content dynamically, so I\'m often ending up with documentFragments which I\'m querying using querySelectorAll or querySelector>
documentFragments
querySelectorAll
querySelector>
I have another suggestion. You can select multiple nodes by query seperator(,):
,
var nodes = document.querySelectorAll('h2, h3');
This code selects all h2 and h3 saved in nodes.
h2
h3
nodes