Coding Challenge: A Dessert List

Let's cover an exercise related to page events, see if you can solve it on your own!

We'll cover the following

Problem statement

The following HTML code defines a list of desserts, empty for now.

Write the JavaScript code that adds a new dessert to the list when the user clicks on the button. The dessert name is chosen by the user.

Bonus points for adding the possibility of changing a dessert’s name when clicking on it.

If you get stuck, you can refer to the given solution.

Get hands-on with 1400+ tech skills courses.