Reputation: 8586
I need assistance with querySelectorAll
. Is there a way to have the function return the elements that only I specify?
i.e. document.querySelectorAll('span.Fz-xxs')
could return an element <span class="blah1 blah2 Fz-xxs">
but I just want it to return elements that are <span class="Fz-xxs">
Upvotes: 1
Views: 74
Reputation: 66663
To select a <span>
with just the class you want (ex: Fx-xxs) and nothing else, you can use:
document.querySelectorAll('span[class="Fz-xxs"]')
Upvotes: 3