querySelectorAll - get ALL tags that have an attribute set?
Asked Answered
F

1

6

For example, I need to have a list of all tags that have id attribute set (it could be any other attribute, id is just an example).

Flemming answered 1/1, 2012 at 17:38 Comment(0)
P
11

Try this:

document.querySelectorAll('[id]')
Pugilist answered 1/1, 2012 at 17:40 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.