I know it might sound stupid but for some reason I`m having some weird problem.
so, I have a code in js which generate a table with a buttons I gave all buttons same class.
when I try to click on them and use jquery function to console.log something nothing happens.
$.each(data,function(i, d){
    $('#myTable tbody').append(`
        <tr>
            <td>${d.Date}</td>
            <td>${d.Name}</td>
            <td>${d.Score}</td>
            <td><button class='graphXY' data=${d.id}>View</button></td>
        </tr>`);
});
its inside ajax and the table generates good and each button gets class and data good.
now when I try to do
$(".graphXY").click(function(){
    console.log("hit");
})
basically nothing happens and for some reason I cant find the reason.
 
    