Today's Question:  What does your personal desk look like?        GIVE A SHOUT

 ALL


  Removing all child nodes from an element

When manipulating the DOM, it's often useful to remove all child nodes from a specific element. This typically comes in handy when you're looking to replace the content of an element with a separate form element, such as an <input>, so the user can edit the actual value.Here's an example of something I recently created that illustrates my point:Get the Flash Player to see this player.These "dynamic form elements" are written to the page only when the user performs a certain action; in this case: clicking on a table cell.The HTML for the table cell ...

3,136 0       JS DOM REMOVE ALL CHILDREN CLEAR JAVASCRIPT CODE