Australian Made and Owned

Adding, Removing and Editing Elements Dynamically using JavaScript

Posted January 19, 2008

Using Javascript to Dynamically Add and Remove Elements While working myLookAgain (the second attempt), I’ve had to use a little bit more AJAX through JavaScript. One of the reasons was that I needed to allow users to add as many ‘pieces’ to each look and delete them if they want - preferably without reloading.

In JavaScript terms, I needed to be able to add (or create) and remove (or delete) elements, within another element, the form. After a little bit of research on the internet, I had what I needed to do just that. See a basic example of javascript dynamically adding and removing elements… Here’s how to do it:
(more…)

Filed under: Javascript, Web Design — Tags: , , , — Tim @ 1:54 pm