Learn localStorage by Building a Todo App - Step 24

Tell us what’s happening:

The question says utilize template literals to set the id, but that is what is done here in this code, is it not…

Your code so far

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

/* file: styles.css */

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

<div class="task" id = `${id}`> </div>    

// 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 24

Hi there!

Spaces causes problem. Indent your code.

how do you indent a code

By pressing space bar/back space key on the keyboard.

Then this should work…

<div class="task" id =`${id}`></div> 

[quote="booleanmethod

Isn’t that looking unusual to you regarding code an attribute and it’s value?
Example:

attribute="value"

id=${id}

How about the template strings the question said should be used

Your code is correct. You need to indent it properly.
When you code an attribute and it’s value. It should not have a space before and after assignment operator. I told you about spacing issue in my previous post.

But this does not have a space…

<div class="task" id =`${id}`></div> 

Brought you a pair of fresh eyes. Can you aren’t see the space before and after = in your above code? Also after }

there’s no space here and it still doesn’t work…

<div class="task" id=`${id}`></div>  

Also remove the template literal strings (back ticks) around ${id}, you need quote marks.

You need like the above, except the ${} around id

But the question says template strings

If you look above and below the editable region within the code editor, you already have a back tick above and below there. So you didn’t need to add back ticks again. You only need the ${}. It’s for embedding JavaScript variables/elements to the html.

It still doesn’t work

Post your updated code.

<div class="task" id=${id}></div>

You haven’t added quote marks around ${id}