select elements with attributes
Select all document elements with a given data attribute.
document.querySelectorAll('[data-attribute]');
copy
Select all document elements with a given data attribute.
document.querySelectorAll('[data-attribute]');
copy