element.dataattribute in js 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'