hi, totally blind, using jaws 2026, windows 11 pro, and google crhome. now the step 29 for closing the form is not passing. have researched it on google, have reset the lesson, done a hard refresh, but it is not passing, so is there hidden characters or stray characters hidden. and cannot see totally blind. so can some one help me out. have written the function a couple of times or three times, and still not passing, is it my code or a bug with fcc? so pasting my java script, errors and the link to the step.
thank you.
marvin.
ps: pasting below.
javascript:
// Get DOM elements
const taskForm = document.getElementById("task-form");
const confirmCloseDialog = document.getElementById("confirm-close-dialog");
const openTaskFormBtn = document.getElementById("open-task-form-btn");
const closeTaskFormBtn = document.getElementById("close-task-form-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 = \[\];
// ✅ Open form
openTaskFormBtn.addEventListener("click", () => {
taskForm.classList.toggle("hidden");
});
// ✅ Close button shows confirmation dialog
closeTaskFormBtn.addEventListener("click", () => {
confirmCloseDialog.showModal();
});
// ✅ Cancel close dialog
cancelBtn.addEventListener("click", () => {
confirmCloseDialog.close();
});
// ✅ Discard changes and close form
discardBtn.addEventListener("click", () => {
confirmCloseDialog.close();
taskForm.classList.toggle("hidden");
});
// ✅ Add task
taskForm.addEventListener("submit", (e) => {
e.preventDefault();
const task = {
id: \`${titleInput.value.toLowerCase().split(" ").join("-")}-${Date.now()}\`,
title: titleInput.value,
date: dateInput.value,
description: descriptionInput.value,
};
taskData.unshift(task);
tasksContainer.innerHTML = "";
taskData.forEach(({ id, title, date, description }) => {
const taskDiv = document.createElement("div");
taskDiv.classList.add("task");
taskDiv.id = id;
const titleP = document.createElement("p");
titleP.innerHTML = \`<strong>Title:</strong> ${title}\`;
taskDiv.appendChild(titleP);
const dateP = document.createElement("p");
dateP.innerHTML = \`<strong>Date:</strong> ${date}\`;
taskDiv.appendChild(dateP);
const descP = document.createElement("p");
descP.innerHTML = \`<strong>Description:</strong> ${description}\`;
taskDiv.appendChild(descP);
const editBtn = document.createElement("button");
editBtn.type = "button";
editBtn.classList.add("btn");
editBtn.textContent = "Edit";
taskDiv.appendChild(editBtn);
const deleteBtn = document.createElement("button");
deleteBtn.type = "button";
deleteBtn.classList.add("btn");
deleteBtn.textContent = "Delete";
taskDiv.appendChild(deleteBtn);
tasksContainer.appendChild(taskDiv);
});
// ✅ Toggle form hidden after submit
taskForm.classList.toggle("hidden");
// Reset inputs
titleInput.value = "";
dateInput.value = "";
descriptionInput.value = "";
});
errors:
Sorry, your code does not pass. Try again.
You should use classList to toggle the class hidden on taskForm.
links: