Jump to content

How to specify querySelectorAll('......') for 2 (!) Tags in 1 statement?


pstein
 Share

Recommended Posts

Assume I have statement

document.querySelectorAll("p") ........

Now I want to apply the full statement not only to <P> tags but also to <div> tags.

Ok, I could write a second statement

document.querySelectorAll("div") ........

but I want to avoid this.

Is there a way to merge the two commands into ONE statement?

 

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...