you can do something like this:
<a class="btn btn-xs btn-danger" id="btn_remove" href="#">Remove</a>
change it to
<a class="btn btn-xs btn-danger btn_remove" href="#" data-id="'. $row->list_id .'">Remove</a>
now write a click event to btn-remove
:
$('.btn_remove').on('click', function() {
var id = $(this).data('id'); // get the `id` from data property
// send a ajax request
$.ajax({
url: '',
data: { id: id },
......
});
});