Source Code:
(back to article)
Submit
Result:
Report an issue
<!DOCTYPE html> <html> <head> <title>Add Elements</title> </head> <body> <div id="container"></div> <script> var newElement = document.createElement('p'); newElement.textContent = 'New Paragraph'; document.getElementById('container').appendChild(newElement); </script> </body> </html>