From my JSFiddle here, Could anyone please tell me why the div
containing id
as button
isn’t getting appending in the following code ?
var newEl = $("<div/>", {
class: "clickable",
//id: "grid" + id,
style: "margin:100px 10px 20px 20px ",
}).append($("<div />", { id: "button"})).appendTo(document.body);
All I see in my console log is this (I clicked on first row of grid , then first row of the newly generated grid below it) and could not find another div with button id: