We would like to know how to use insertAdjacentHTML to insert DOM element.
<!DOCTYPE html>
<html>
<body>
<div id="one">one</div>
<script type='text/javascript'>
var d1 = document.getElementById('one');
var d3 = document.createElement('div');
d3.innerHTML = 'three';
d1.insertAdjacentHTML('afterend', '<div id="two">two</div>');
d1.insertAdjacentHTML('afterend', d3);
<!--from w w w. j a v a 2s. co m-->
</script>
</body>
</html>
The code above is rendered as follows: