Add and Remove Elements
General
Dynamically create HTML elements with content wrapped within them according to the DOM2 specification. Easy to implement.
Notes
- Created by: Dustin Diaz
- Web Site: http://www.dustindiaz.com/
- Posted: February 15, 2008
Source Code
Paste this source code into the designated areas.
External file
Paste this code into an external JavaScript file named: addRemoveElements.js
CSS
Paste this code into your external CSS file or in the <style> section within the HEAD section of your HTML document.
Head
Paste this code into the HEAD section of your HTML document.
Body
Paste this code into the BODY section of your HTML document


Leave a Response
(5 comments)It should work as is. If you keep pressing the button, it will just keep adding more.
Are there additional examples of use of the script.[br /]I don't see how to expand upon the 4 lines of code in the BODY section.
Thanks for the tip. It's been fixed now.
Trying the "Send Script" displays a pop-up window with error message[br /][br /]"ERROR: Script add-and-remove-elements.html is missing at /www2/jss/cgi-bin/scriptbot2.cgi line 53."[br /][br /]This seems to be true using any of my browsers
Cool script. Congratulations!