Re-number the id's of table rows using jQuery
问题 I have the following table code: <tbody> <tr data-id='1' id='item-1'> <td>30-01-2014</td> </tr> <tr data-id='19' id='item-2'> <td>30-01-2014</td> </tr> <tr data-id='5' id='item-3'> <td>30-01-2014</td> </tr> <tr data-id='39' id='item-4'> <td>30-01-2014</td> </tr> </tbody> and the jQuery: $('table tbody').sortable({ axis: 'y', update: function (event, ui) { var data = $(this).sortable('serialize'); $.ajax({ data: data, type: 'POST', url: 'updatePagesOrder.php' }); } }); var i = 1; $('table >