Hi everyone I am facing some issues while trying to pass JSON object as a parameter to function!
but on that function, while consoling log the data I am getting [object:object].
Here is my code:-
function buildTable(data){
var table = document.getElementById('myTable');
table.innerHTML ="";
for(var i =0; i<data.length; i++){
var row = `<tr class="item-id-${data[i].id}"> <td>${data[i].name}</td> <td>${data[i].audio_muted}</td> <td>${data[i].video_muted}</td> <td><button id="audio_handle" class="btn btn-primary" onclick="handleMembers('${data[i]}')">Video</button></td>`
table.innerHTML += row;
}
}
function handleMembers(data){
console.log("data = >",data); //= [object:object]
}
The issue is when I am calling handle function from the button inside template literal string I m getting [object:object] as output
Where I am going wrong kindly help me.