JavaScript DOM Scripting By Example Editing and Filtering Names Fix DOM Manipulation Code

Arihant Tripathy
Arihant Tripathy
8,002 Points

How do I do this?

How do I embolden the list item with the corresponding index?

1 Answer

Brendan Whiting
MOD
Brendan Whiting
Front End Web Development Treehouse Moderator 84,071 Points

Right now there's an if block on line 12 where the condition is always false. They need you to change this condition so that it's true only if the number in the text field is the same as the index of the list item.

We're inside a for loop and each list item has an index i as we're iterating through. There's also a variable index where we're storing the number from the text field. So we want to check to see if i and index are the same.

Let me know if you have more questions.