Appending to specific element append text only


I have prepended one div inside some div with many others:

<div class="content">
<div>sss</div>
<div>aaa</div>
<div>bbb</div>
</div>

I added <div>ddd</div> before sss with:

$('.content').prepend('<div></div>');

And when I want to append some new element to new prepended div it add's it as text:

$('.content>div')[0].append('<p>ddd</p>');

If I remove [0] it works but it appends to all divs, I need that [0] to find first div.

To get the first element (that is still a jquery object) you can use .first():

$('.content>div').first().append($('<p>ddd</p>'));

Note that I also wrapped the <p> with $(...) to make it a valid html element (and not text).