Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jquery perform append/prepend but in the middle, like midpend, or specify pend location?

Tags:

jquery

http://jsfiddle.net/motocomdigital/6DeAC/

I like to pend some some mark up to a div. But I need the pend to appear in between child elements of my div. Is this possible?

Please see my example below.

<div class="bx-wrapper">

    <div class="bx-window">window</div>

    <a href="" class="bx-prev">prev</a>
    <a href="" class="bx-next">next</a>

</div>


So I need the pended div to appear here...

<div class="bx-wrapper">

    <div class="bx-window">window</div>

    <div id="pendHere">pend</div>

    <a href="" class="bx-prev">prev</a>
    <a href="" class="bx-next">next</a>

</div>


Can any one help me with me this, would be much appreciated.

See fiddle here... http://jsfiddle.net/motocomdigital/6DeAC/


Thanks

like image 476
Joshc Avatar asked Dec 26 '22 15:12

Joshc


1 Answers

$('<div id="pendHere">pend</div>').insertAfter('.bx-wrapper .bx-window');
like image 98
Kirill Ivlev Avatar answered May 25 '23 10:05

Kirill Ivlev