function
funMake() {
var
val = document.getElementById(
'd1'
);
elP = document.createElement(
'P'
elP.innerHTML =
'Hello World!'
;
val.insertBefore(elP, val.childNodes[1]);
'To be or not to be?'
val.insertBefore(elP,
null
}
<!DOCTYPE html>
<
html
>
head
meta
charset
=
"utf-8"
/>
title
>New Page</
script
src
"js/script.js"
></
</
body
div
id
"d1"
p
>Привет Мир!</
funMake();