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

JavaScript tabs not working

Not sure why it get's only the last link of the tab links. It get's the 4th item.

However it should get the one that I press, not the last one.

How come is that? I guess that the loop has run through and it ended up on the last item.

How can I make this work?

Here is the codepen

I guess I need to specify it somehow with [0] or [1] but doesn't work.

1 Answer

Steven Parker
Steven Parker
243,656 Points

I'm not seeing the issue. When I click any tab, it is highlighted and the proper paragraph appears.

Yeah, after 7 hours had time to figure it out xd

But I have plenty of questions if you don't mind me asking?