vanilla js get element by data attribute code example
Example 1: jquery select by data attribute
$('div[data-key=value]');
Example 2: get data attribute javascript
// <div id="element" data-name="john"></div>
const el = document.querySelector('#element')
el.dataset.name // 'john'