Co GetTtribute zwraca NULL dla danych-* atrybuty
//Try this
var e = document.getElementById("your-elements-id");
var data1 = e.getAttribute("data-yourData");
var data2 = e.dataset.yourdata;
Black Badger