This page shows a example of how to add HTML content with JavaScript. Press the following button to see a paragraph inserted.
Click Me
Take a look at the HTML Source. We use “document.createElement()” to create a new HTML element, then “document.createTextNode()” to create a text. Then “appendChild()” to attach the text to the newly created element, then finally “appendChild()” again to add the new element into the HTML document.
References:
See also:
Page created: 2006-02. © 2006 by Xah Lee.