Assuming I have the following divs:
<div id="mydiv">
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
</div>
How can I in jquery or javascript make it such that I can append an element right after the first child of “mydiv”. Or is there some selector to allow me to select and append after the first child?
<div>
<div>1</div>
<div>Place to Insert Subsequent div</div>
<div>2</div>
<div>3</div>
<div>4</div>
</div>
You can do this using
:first-childandafter:Demo