javascript - How to collect all data attributes and push to an array -
i have series of table rows data attributes. collect value of these data attributes , add them array. how do this?
<tr data-title-id="3706" role="row" class="odd"></tr> <tr data-title-id="3707" role="row" class="odd"></tr>
or simplest method create array , fill in 1 step:
var dataids = $("table tbody tr").map(function() { return $(this).data('title-id'); });
Comments
Post a Comment