For this html
this js:
console.log($(\'div\').data(\'a\'));
retur
You can bypass data() and grab the attribute directly:
data()
console.log($('div').attr('data-a'));
Demo