Add input values as bullets on same page

PHOTO EMBED

Sat May 07 2022 22:24:42 GMT+0000 (Coordinated Universal Time)

Saved by @Luduwanda #javascriptreact

// Leave the next line, the form must be assigned to a variable named 'form' in order for the exercise test to pass
const form = document.querySelector('form');
const product = document.querySelector("#product");
const qty = document.querySelector("#qty");

const groceryList = document.querySelector('#list');

form.addEventListener("submit", function(evt){
    evt.preventDefault();
    const newLI = document.createElement("LI");
  //innerHTML or innerText or textContent
    newLI.innerHTML = `${product.value}${qty.value}`
    groceryList.appendChild(newLI);
    product.value = ""
    qty.value = ""

});
content_copyCOPY