I am creating a table row dynamically. Each row is having onclick event. When I click on that table row I want to pass row object to a function but my problem is, while passing that object, I am getting [object object] string. So I am not able to use that object in function.
Please give some solution thanks in advance.
This is my code:
var row;
$.each(mydata, function(i,data){
row+='<tr onclick="myfunction(\''+data+'\')"><td >data.name</td><td >data.age</td></tr>;
});
$("#myTable").append(row);
<tr onclick="myfunction("[object Object]'')>....?