Which DOM selection method would you use to find all elements with a data attribute?
document.querySelectorAll('[data-*]') would be used to find all elements with any data attribute. The attribute selector in CSS, denoted by square brackets [], allows you to select elements based on their attributes. You can be more specific by using a particular data attribute name, like document.querySelectorAll('[data-role]') to find elements with the data-role attribute, or even target specific values with document.querySelectorAll('[data-role="button"]').