Learn localStorage by Building a Todo App - Step 18

Tell us what’s happening:

I am stuck on step 18 of how to create a todo app.
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.

const div = document.createElement(‘div’)
div.classList.add(‘task’);
div.id = ${id}

Your code so far

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

/* file: styles.css */

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

  const div = document.createElement('div');
  div.classList.add('task');
  div.id = `${id}`;

// User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36

Challenge Information:

Learn localStorage by Building a Todo App - Step 18

The lesson wants you to create an actual div element

<div>...

you don’t need this here

for your div you will add your class and id

so you don’t need the classlist or div.id either.

your answer should be similar to what you did earlier in the music player project when you were writing stuff like this

   <li id="song-${song.id}" class="playlist-song">

hope that helps