Learn localStorage by Building a Todo App - Step 6

Tell us what’s happening:

The answers in the forum on this seems to be around the place. the method says use the element -hidden- and the element -hidden- is used as requested, why then does it not work

Your code so far

<!-- file: index.html -->

/* file: styles.css */

/* file: script.js */
// User Editable Region

openTaskFormBtn.addEventListener("click",() => {hidden.classList.toggle()})

// User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36

Challenge Information:

Learn localStorage by Building a Todo App - Step 6

Hello,
you did not use the taskForm element as stated, if you look carefully at your code there is no variable in it called hidden, that is a name of a class

so where is the name “hidden” to be used…

It’s should be used within the toggle() method.

But the question does not say it should be a parameter…

element.classList.toggle("class-to-toggle");

You have the above example in the challenge instructions. hidden is a class value. You need to toggle the hidden class. Element should be taskForm

Then this should work?:

openTaskFormBtn.addEventListener("click",() => {taskform.classList.toggle("hidden")})

Double check the variable name. It’s not taskform exactly.

It works! Thank you for the help

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.