Add form values to .details
using document.createElement
and appendChild
, instead of innerHTML
.
Break out some of this functionality into a separate function.
Do not hard-code the names of the fields in your JavaScript. Loop over all of the elements in the form.
- User can enter a name to be added to the roster.
- Name will be added to the end of a list.
- Create at most one global variable.
- Add names to the top of the list.
- Add a delete button to every list item that removes the name from the list when clicked.
- Add a promote button to every list item that changes the appearance (e.g. changes the background color, adds a border, etc.) of that item when clicked.