Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

before in javascript

<button onclick="fun_name()">Insert</button>

<script>
 function fun_name()
 {
  var elem = document.getElementById("idDiv2");
  elem.before("New Content");
  
  var elem2 = document.getElementById("idDiv1");
  alert(elem2.outerHTML);      
 }
</script>
 
PREVIOUS NEXT
Tagged: #javascript
ADD COMMENT
Topic
Name
2+3 =