I am dynamically appending a div element to an existing div. But immediately following that, I need to append another div to the div I just created dynamically. But I can't seem to find the dynamically created div in order to append to it. I assume maybe the DOM isn't aware of that div yet since I just made it. How do I do this?
var serialModel = "Test Test";
$("#existingDiv").append("<div id = '" + serialModel + "'></div>");
$("#" + serialModel).append("<div>content here</div>")
The last line doesn't do anything. The second line produces the new div, but then I can't find it to append to it.