odin-codespace/inventory/public/js/components/addForm.js
2025-01-17 22:45:33 -05:00

14 lines
369 B
JavaScript

function addForm() {
let buttonClicked = true;
const addForm = document.querySelector(".add-form");
const button = document.querySelector(".add-btn");
button.addEventListener("click", () => {
buttonClicked
? (addForm.style.display = " block")
: (addForm.style.display = "none");
buttonClicked = !buttonClicked;
});
}
export { addForm };