How can i get the data attribute of the last table row?
<tbody id="tableNotifications">
<tr class="notificationsRowEntry success" data-notification-timestamp="1384105387"></tr>
<tr class="notificationsRowEntry success" data-notification-timestamp="1384105367"></tr>
<tr class="notificationsRowEntry success" data-notification-timestamp="1384105357"></tr>
<tr class="notificationsRowEntry success" data-notification-timestamp="1384105323"></tr>
</tbody>
The problem is that i can't get the data attribute but only the content of the last table row using:
$data = $("#tableNotifications").last().data("notification-timestamp");
Maybe i'm doing a stupid mistake but it's driving me crazy.
Thank you.
P.S. I know that i could add some unique ids and then fetch the data with
$data = $(uniqueid).data("notification-timestamp");
but i would like to avoid that.