1. Home
  2. Javascript
  3. Select elements with attributes
#javascript#select

Select all document elements with a given data attribute.

document.querySelectorAll('[data-attribute]');
copy
Full Javascript cheatsheet
Sitemap Git repository