Tengo un padre div como este.Cómo agregar div de manera dinámica dentro de un div usando jQuery. ¿Debería mostrar primero también?
<div id='parent'>
<div id='child_1'>........</div>
<div id='child_2'>........</div>
<div id='child_3'>........</div>
<div id='child_4'>........</div>
</div>
Quiero añadir un div así:
<div id='page_number'> You are watching 5th object out of 100 </div>
Dentro div padre estoy usando agregar a hacerlo así.
$("#parent").append("<div id='page_number'> You are watching 5th object out of 100 </div>");
Pero viene después child_4 th div. Pero necesito mostrarlo justo debajo de child_1. No debería ser como esto
<div id='parent'>
<div id='page_number'> You are watching 5th object out of 100 </div>
<div id='child_1'>........</div>
<div id='child_2'>........</div>
<div id='child_3'>........</div>
<div id='child_4'>........</div>
</div>
¿Cómo puedo hacer como esto.