This piece of code will return the value of the data attributes eg: data-id, data-time, data-name etc.., I have shown for the id
<a href="#" id="click-demo" data-id="a1">Click</a>
js:
$(this).data("id");
// get the value of the data-id -> a1
$(this).data("id", "a2");
// this will change the data-id -> a2
$(this).data("id");
// get the value of the data-id -> a2