how to target data attribute js code example Example: how to select data attribute in javascript const link = document.querySelector('[data-link="1"]');