Deleting Specific Nodes
While always deleting the last paragraph might be interesting, you'll sometimes want to delete something that's not at the end of the page. Scripts 12.5 and 12.6 make our code considerably more flexible, allowing the user to decide which paragraph is history, as shown in Figures 12.4 and 12.5.
Script 12.5. Radio buttons let you offer your visitors the choice of adding or deleting text.
Script 12.6. This script allows users to choose which paragraph they want to delete.
Figure 12.4. After adding nodes, the Paragraph # pop-up menu contains a list of paragraph numbers.
Figure 12.5. First, you click the Delete node radio button, and then you choose a paragraph to delete from the pop-up menu (top). Clicking the Submit button wipes out the selected paragraph (the Mark Twain quote) and moves up the following paragraph (bottom).
To delete a particular node: