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 11.5 (the HTML) and 11.6 make our code considerably more flexible, allowing the user to decide which paragraph is history, as shown in Figures 11.4 and 11.5.

Figure 11.4. After adding nodes, the Paragraph # pop-up menu contains a list of paragraph numbers.

Figure 11.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 ...

Get JavaScript and Ajax for the Web: Visual QuickStart Guide, Seventh Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.