The task is “Create a div element with the class of task. Utilize template strings to set the id attribute of the div to the id you destructured from the task data.”
My Solution is =“tasksContainer.innerHTML += <div id="\${id}" class="task"></div>;”
Getting Error=“You Should create a div element with the class task”.
Please help
Your code so far
<!-- file: index.html -->
/* file: script.js */
// User Editable Region
tasksContainer.innerHTML += `<div id="\${id}" class="task"></div>`;
// User Editable Region
/* file: styles.css */
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36
Challenge Information:
Learn localStorage by Building a Todo App - Step 24
Edit: also, you don’t need the backticks. They were given to you on lines above and below the editor, but you’ve placed all the code on one line so that may confuse the test. I would reset and just type in the required div on the empty line provided.
Still getting same error.
My Solution is tasksContainer.innerHTML +=<div id="${id}" class="task"></div>;
Task is = Create a div element with the class of task . Utilize template strings to set the id attribute of the div to the id you destructured from the task data.
Error Prompt= You should create a div element with the class task .
Please help me
It is great that you solved the challenge, but instead of posting your full working solution, it is best to either pick the post that helped you to mark it as the solution or give a summary of the corrections you made without writing out the actual code.
We are trying to cut back on the number of spoiler solutions found on the forum and instead focus on helping other campers with their questions.