Prev Demo
DOM Elements
Next Demo
Write code here
J
|
B
|
A
<!DOCTYPE html> <html> <head> <title>Demo</title> </head> <body> <p id="first">TechFunda</p> <p id="demo"></p> <script> var a = document.getElementById("first"); document.getElementById("demo").innerHTML = "The text from the first paragraph is " + a.innerHTML; </script> </body> </html>
Note: We DO NOT save your trial code in our database.
Output