This is part of my code for the table. it works but I would like to add button
var html = "<table>";
for(var i=0; i<prodArray.length; ++i){
htmlStr += "<td>" + prodArray[i].name + "</td>";
htmlStr += "<tr>";
htmlStr += "<td><img width=200 height=200 src='" + prodArray[i].image_url +
"'></td>";
htmlStr += "<td>" + prodArray[i].price + " coins" + "</td>";
// This bit with the button is not working
htmlStr += "<td><button type=button> Click Me!</button"'></td>";
htmlStr += "</tr>";
}
Please help.
var html = '<table>';, but then you add tohtmlStr, a different variable. It would be better if you could use Stack Snippets to provide an minimal reproducible example.