Javascript examples for DOM:Document createElement
Insert element before an element inside DOM
<html> <head> <title>JS</title> </head> <body> <script type="text/javascript"> var//from w w w . j av a 2 s .com scriptElement, script; scriptElement = document.createElement('script'); scriptElement.src = "https://code.jquery.com/jquery-2.2.2.min.js"; script = document.getElementsByTagName('script')[0]; script.parentNode.insertBefore(scriptElement, script); </script> </body> </html>