Source Code:
(back to article)
Submit
Result:
Report an issue
<!DOCTYPE html> <html> <head> <title>Simple DOM Example</title> </head> <body> <script> // Make a new part of the page const paragraph = document.createElement("p"); paragraph.innerText = "Hello, JavaScript!"; // Add the new part to the page document.body.appendChild(paragraph); </script> </body> </html>