D
D
DiseaseC2020-05-13 18:19:30
JavaScript
DiseaseC, 2020-05-13 18:19:30

Inside document.querySelectorAll("tag1", "tag2"), how do you know which selector you are referring to?

I need to select several elements at once through querySelectorAll, and then do this:
if tag1 is selected - do something
if tag2 - do something else?
Can you tell me how to implement?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
galaxy, 2020-05-13
@DiseaseC

Check element.tagName

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question