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 Loops, Arrays and Objects Tracking Multiple Items with Arrays Build a Quiz Challenge, Part 2 Solution

Himanshu Chopra
Himanshu Chopra
3,055 Points

Hello! Here is my working code. Feedback appreciated & also I need one help!

Can somebody tell me how can print my final output inside the div which has the id 'output'. I tried document.getElementByid('output') and tried to print it inside it but not getting the desired result. Please help me with this!

Here is the Snapshot: https://w.trhou.se/wq9w56vfjr

1 Answer

rydavim
rydavim
18,814 Points

Can you elaborate? Your code seems to be working for me.

Edit - I originally misunderstood your question, whoops! I now understand what you're asking. I'll update this shortly.

Update

Workspace is failing to load for me at the moment, but you're likely looking for innerHTML.

// Something like...
document.getElementById('output').innerHTML(message);

Hopefully that helps. I'll make sure that works as soon as I can successfully open workspace.

Himanshu Chopra
Himanshu Chopra
3,055 Points

Thanx rydavim. I am sorry if I was wrong in explaining things. Sure you can update it when you have time :)

rydavim
rydavim
18,814 Points

I can't open workspace right now, but I've updated the answer to include a documentation link and (probably) working code.