Thursday, June 21, 2018

javascript - click on element with same class

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(`

${d.Date}
${d.Name}

${d.Score}

`);
});


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.

No comments:

Post a Comment

plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...