15
rated 0 times
[
20]
[
5]
/ answers: 1 / hits: 27200
/ 8 Years ago, fri, september 2, 2016, 12:00:00
I need to get the value of userid, data-attribute from a html table and put this value into a var, but I wanna to this action without click action.
<table id=tblList>
<tbody id=someTest>
<tr data-userid=801992084067>
<tr data-userid=451207954179>
<tr data-userid=310896831399>
<tr data-userid=863939754980>
<tr data-userid=1123542226482>
</tbody>
</table>
I have tried to do this like that, but the rowId is undefined.
var rowId = $(#someTest tr).last().attr([data-userid]);
More From » jquery