1<button onclick="fun_name()">Insert</button>
2
3<script>
4 function fun_name()
5 {
6 var elem = document.getElementById("idDiv2");
7 elem.before("New Content");
8
9 var elem2 = document.getElementById("idDiv1");
10 alert(elem2.outerHTML);
11 }
12</script>