<!DOCTYPE html>
<html>
<body>
<div></div>
<script type='text/javascript'>
var el = document.getElementsByTagName('div')[0];
var s = document.createElement('script');
s.text = 'console.log("abc");'
el.parentNode.insertBefore(s, el.nextSibling)
</script>
</body>
</html>