I am trying to append text to a div which has been dynamically created. Within this div there are 2 child divs, one for title and one for the body.
This main div is droppable, however I want that when the item is dropped, the text enters into the child div “body”.
I currently have the following code which appends the text to the main div.
$($(this)).append(draggableText + '<br>');
The name of the child div is #catPileBoxBody
However there are 3 of these which have been dynamically created. So is there a way of inserting the text into something like:
$($(this."CHILD called #catPileBoxBody")).append(draggableText + '<br>');
Any help would be massively appreciated! I have been stumped on this for AGES!
But as you should have only one element with a given ID, you should be able to simply do
The fact that the divs have been created dynamically changes nothing.