//javascript get html data attribute
const btns=document.querySelectorAll('button[data-id]');
[...btns].forEach(btn => console.log(btn.getAttribute('data-id')))
Example 2: dataset js
for javascript :
webappData.getAttribute('data-id');
document.querySelector('#elementId').dataset.id = 'value';
for jquery :
$(element).attr('data-key', 'value');