js event take element by data attribute code example
Example: get data attribute javascript
// <div id="element" data-name="john"></div>
const el = document.querySelector('#element')
el.dataset.name // 'john'
// <div id="element" data-name="john"></div>
const el = document.querySelector('#element')
el.dataset.name // 'john'