Reputation: 431
i have a table and a hidden field inside a td in it which stores the primary key .while deleting the table row i like to retrieve this value and add it to another hidden field
i want to retrieve the data in hidden field for this deleted row ??
Upvotes: 1
Views: 270
Reputation: 630569
When you delete the row, likely using .remove()
you can still query it's elements, for example using .find()
like this:
$(".delete").click(function() {
var id = $(this).closest("tr").remove().find("input[type=hidden]").val();
//do something with the ID
});
Upvotes: 2