2

Trying to do some front end design work and I needed to do some debugging/testing of my css.

I know with most browser dev tools, I can click on an elements and get a full style trace.

But what I want to do is the reverse.

I know the selector and I wish to find all elements that are associated with it (simple ctrl+f not working out)

How would I go about this?

PrivatMamtora
  • 2,072
  • 2
  • 19
  • 29

1 Answers1

5

You can surely do this in the normal Javascript console with document.querySelectorAll.

So if you want to find all the elements that match body div.heading h1, do

document.querySelectorAll('body div.heading h1');

The browser console will show the elements it has found. Most also highlight them in the page when you mouseover the listing in the console.

lonesomeday
  • 233,373
  • 50
  • 316
  • 318