Task |
Use Javascript to add interactivity to a web page |
Conditions |
A HTML webpage with JS loaded after the HTML |
Standards |
Use Javascript to do all of the following: - Select the
<body> element - Add a list element as a child of the body
- Add 2 button as children to the
<body> element - The first button should add an list item element to the newly created list
- The second button should remove a list item from the list
- Make an event that listens for a click on one of the list items and when that event happens something updates (example: the background color updates) using
.classList.add and .classList.remove
|
Notes
- Please use
addEventListener
instead of onclick
. We will use onclick
later in the course.
References