Learn localStorage by Building a Todo App - Step 18

Tell us what’s happening:

I do not understand why my code isn’t working, if someone can explain it to me please.

Error : You should create a div element with the class task. Your div element should have the id ${id}.

Your code so far

taskData.forEach(({id, title, date, description}) => {
      (tasksContainer.innerHTML += `
        <div id=${id} class="task"></div> 
      `)
    }
  );

Challenge Information:

Learn localStorage by Building a Todo App - Step 18

1 Like

Remember the id should be in quotes

3 Likes

And the parser expects the class attribute to be first and then the id attribute. It is very picky about the ordinal position of those two within the string.

2 Likes

Yes, thank you guys :man_bowing: !

1 Like