JSFiddle - React, Tailwind, and code Playground

HTML

<table>
    <tr><td>
        <p>file with id 1</p>
        <button data-id="1">download</button>
     </td></tr>
    <tr><td>
        <p>file with id 2</p>
        <button data-id="2">download</button>
    </td></tr>
    <tr><td>
        <p>file with id 3</p>
        <button data-id="2">download</button>
     </td></tr>
</table>

JavaScript

$('button').on('click', function(e){
    e.preventDefault();
    
    var id = $(this).data('id');
   	
    alert('Do ajax request to download file with id ' + id);
})