편집 강령:
결과보기 »
그것을 자신을 시도 - ©
w3ii.com
<
!DOCTYPE
html
>
<
html
>
<
body
>
<
h1
id
="intro"
>
My First Page
<
/h1
>
<
p
id
="demo"
>
Hello World!
<
/p
>
<
script
>
myText = document.getElementById(
"intro"
).firstChild.nodeValue;
document.getElementById(
"demo"
).innerHTML = myText;
<
/script
>
<
/body
>
<
/html
>
<!DOCTYPE html> <html> <body> <h1 id="intro">My First Page</h1> <p id="demo">Hello World!</p> <script> myText = document.getElementById("intro").firstChild.nodeValue; document.getElementById("demo").innerHTML = myText; </script> </body> </html>