Tell us what’s happening: I tried completing this step but I feel like maybe I’m not reading the instructions right. When I try checking my line of code below, I get a error message that says “Your event listener should include a callback function for the second argument using arrow syntax without curly braces. Then you should use the classList property and its toggle method on the taskForm, to toggle the class hidden.” Is there something that I’m missing here or reading wrong or maybe wrong syntax? the button works when I click on it.
Your code so far
openTaskFormBtn.addEventListener(“click” , () => taskForm.classList.toggle(“hidden”));
WARNING
The challenge seed code and/or your solution exceeded the maximum length we can port over from the challenge.
You will need to take an additional step here so the code you wrote presents in an easy to read format.
Please copy/paste all the editor code showing in the challenge from where you just linked.
const confirmCloseDialog = document.getElementById("confirm-close-dialog");
const openTaskFormBtn = document.getElementById("open-task-form-btn");
const closeTaskFormBtn = document.getElementById("close-task-form-btn");
const addOrUpdateTaskBtn = document.getElementById("add-or-update-task-btn");
const cancelBtn = document.getElementById("cancel-btn");
const discardBtn = document.getElementById("discard-btn");
const tasksContainer = document.getElementById("tasks-container");
const titleInput = document.getElementById("title-input");
const dateInput = document.getElementById("date-input");
const descriptionInput = document.getElementById("description-input");
const taskData = [];
let currentTask = {};
openTaskFormBtn.addEventListener("click" , () => taskForm.classList.toggle("hidden"));
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36
Challenge Information:
Learn localStorage by Building a Todo App - Step 6