Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

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

Arihant Tripathy
Arihant Tripathy
8,764 Points

How do I do this?

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

1 Answer

Brendan Whiting
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Brendan Whiting
Front End Web Development Techdegree Graduate 84,738 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.