function
funMake() {
var
val0 = document.getElementById(
'd1'
);
val0.innerHTML =
'<h3>'
+ document.getElementById(
'p1'
).previousSibling.innerHTML +
'</h3>'
;
val1 = document.getElementById(
'd2'
val1.innerHTML =
'p2'
}
<!DOCTYPE html>
<
html
>
head
meta
charset
=
"utf-8"
/>
title
>New Page</
script
src
"js/script.js"
></
</
body
div
p
>Hello World!</
id
"p1"
>Привет Мир!</
>To be or not to be?</
"d1"
><
"p2"
"d2"
funMake();