What is the pattern to creating a button which do some action using `AJAX`?

I work with `Django-tables2` and I'm not sure what to put into the row to delete this object using `AJAX`. This works but I would like to know what is the most common approach. Where to put `id` of the object?

So I have a `view` which deletes the object using it's `id`. Currently, I put an `id` of the object as a value of the button and name "delete-button".

In `JS` file, `JQuery`, after click on button checks, which type of button is it (delete or confirm), then checks for `id` and send request to my-site/delete-object/.

```
def delete_object(request,id):
    # deletes the object
    # returns JSON 

```

This is my current `HTML`, should I change way I provide data to `AJAX`?

```
delete = tables.TemplateColumn('<button name="delete-button" 
id="" value={{record.id}} type="button">Delete order</button>')

```

I did not put "delete-button" string as an `id` because there are multiple delete buttons in the table - each row has it's own.

And I did not put `{{record.id}}` as an `id` because there are two types of buttons so both buttons would have the same `id`.