<body>
<style>
.div
{
border:1px solid black;height:10px;padding:20px;font-size:10.2pt;margin:20
}
</style>
<div id=c>
<div id=c1 class="div">c1</div>
<div id=c2 class="div">c2</div>
</div>
<button onclick="fInsert()">insert</button>
<script>function fInsert()
{
if(document.getElementById("c3"))return;
var c3=document.createElement("div")
c3.innerHTML="c3 <a href='javascript:void(fRemove())'>remove</a>";
c3.id='c3';
c3.className="div";
c.insertBefore(c3,c2)
}
function fRemove()
{
c3.parentNode.removeChild(c3)
}
</script>
</body>