list
let nameList = [];
const submitButton = document.getElementById("submit-button");
submitButton.addEventListener("click", function(event) {
event.preventDefault();
const nameField = document.getElementById("name-field");
const name = nameField.value;
nameList.push(name);
const listContainer = document.getElementById("list-container");
listContainer.innerHTML = "";
const list = document.createElement("ul");
for (const name of nameList) {
const listItem = document.createElement("li");
listItem.textContent = name;
list.appendChild(listItem);
}
listContainer.appendChild(list);
});