How do I give append / prepend to a div that has a fixed child using jQuery.
For example:
<div class="container">
<div class="placeholder"></div>
</div>
When you give the first append / prepend, you need to insert the content after .placeholder
. The next ones should be relative to the already added element.
For example:
Append elem um
<div class="container">
<div class="placeholder"></div>
<div class="elem um"></div>
</div>
Append elem dois
<div class="container">
<div class="placeholder"></div>
<div class="elem um"></div>
<div class="elem dois"></div>
</div>
Prepend elem tres
<div class="container">
<div class="placeholder"></div>
<div class="elem tres"></div>
<div class="elem um"></div>
<div class="elem dois"></div>
</div>
I've tried:
$('.container').find('.placeholder').after().prepend(elem_x);
$('.container').find('.placeholder').after().append(elem_x);
$('.container').find('.placeholder').next().prepend(elem_x);
$('.container').find('.placeholder').next().append(elem_x);