diff --git a/14-grocery-bud/final/app.js b/14-grocery-bud/final/app.js index 780530c2e..0f85e7a54 100644 --- a/14-grocery-bud/final/app.js +++ b/14-grocery-bud/final/app.js @@ -1,7 +1,7 @@ // ****** select items ********** const form = document.querySelector(".grocery-form"); -const alert = document.querySelector(".alert"); +const alertBox = document.querySelector(".alert"); //renamed const grocery = document.getElementById("grocery"); const submitBtn = document.querySelector(".submit-btn"); const container = document.querySelector(".grocery-container"); @@ -75,15 +75,15 @@ function addItem(e) { } // display alert function displayAlert(text, action) { - alert.textContent = text; - alert.classList.add(`alert-${action}`); - // remove alert + alertBox.textContent = text; + alertBox.classList.add(`alert-${action}`); setTimeout(function () { - alert.textContent = ""; - alert.classList.remove(`alert-${action}`); + alertBox.textContent = ""; + alertBox.classList.remove(`alert-${action}`); }, 1000); } + // clear items function clearItems() { const items = document.querySelectorAll(".grocery-item");