I'm trying to select two different elements with different classes within the same node list. For example, if I could use this code:
document.querySelectorAll(".a, .b");
It would mean selecting elements with the ".a" class, but also including any elements with the ".b" class that are in between them in the list, not just at the end. They should be placed according to their position in the structure as if they all had the same class.
For instance, if I have the following HTML:
<div class="a">
<div class="b">
<div class="a">
The first element with the ".a" class would be listed first, followed by the ".b" element, and then the second element with ".a" class would be third in the list.