Removing Elements from the DOM

Enter text in the input field and press return. Point the mouse cursor at an item in the list. Click the item to delete it.

This app shows how to programmatically remove an element from the DOM.

In this example, when you click an item in the list, the event handler for the <li> element removes itself from the DOM tree. When the DOM tree changes, the web page refreshes.

Read this tutorial for more detail, or read the source.

See all samples.