I have a parent div like this.
<div id='parent'>
<div id='child_1'>........</div>
<div id='child_2'>........</div>
<div id='child_3'>........</div>
<div id='child_4'>........</div>
</div>
I want to add one div like this:
<div id='page_number'> You are watching 5th object out of 100 </div>
Inside parent div I’m using append to do like that.
$("#parent").append("<div id='page_number'> You are watching 5th object out of 100 </div>");
But its comming after child_4 th div. But I need to display it just below of child_1.
It should come like this
<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>
How can I do like this.
make use of jquery function
.prepend(): Insert content, specified by the parameter, to the beginning of each element in the set of matched elements