select based on data attribute javascript code example
Example 1: how to select data attribute in javascript
const link = document.querySelector('[data-link="1"]');
Example 2: select by data attribute
$('*[data-id="your_id"]');
const link = document.querySelector('[data-link="1"]');
$('*[data-id="your_id"]');